Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: To test empty array in perl

by nagalenoj (Friar)
on Apr 27, 2010 at 04:44 UTC ( #837020=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    print "Array isn't empty.Array Values:@array\n" if($array[0]);
    
  2. or download this
    # my @array = (0, undef, 1, 2, 3);
    my @array = (undef, undef, 1, 2, 3);
    
    print "Array isn't empty.Array Values:@array\n" if($array[0]);
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2014-12-27 13:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls