Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Is there a better way to check if an array is empty?

by fisher (Priest)
on Dec 21, 2010 at 11:17 UTC ( [id://878228]=note: print w/replies, xml ) Need Help??


in reply to Is there a better way to check if an array is empty?

Try to add/remove some 'pop's' here:
my @a = ( 1,3,5,7 ); pop @a; pop @a; print "\@a is (" . (join ", ", @a) . ")\n"; unless (@a) { print "empty\n" }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://878228]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (10)
As of 2024-04-18 16:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found