P is for Practical | |
PerlMonks |
Re: How do I test if an array is empty or not?by Fastolfe (Vicar) |
on Nov 12, 2000 at 21:57 UTC ( [id://41203]=note: print w/replies, xml ) | Need Help?? |
As a supplement to merlyn's answer, never be tempted to use defined on an array (or a hash for that matter). Simply testing the value of the @array in a scalar context is sufficient. The defined function makes little sense on any data type other than a $scalar.
In Section
Seekers of Perl Wisdom
|
|