[Israel.pm] Testing for non-empty array

amit sides amit.sides at gmail.com
Sun Apr 10 20:45:32 PDT 2005

Issac Goldstand wrote:

>Can people suggest elegant ways to see if a method call of an object
>($obj->method) returns a non-empty array (or conversely, returns an
>empty one)?
>Everything I try just seems messy - too many typecasting sort of things,
>since that darn $ is there...
>Or maybe I'm just not thinking at 4AM ;-)
>  Yitzchak
>Perl mailing list
>Perl at perl.org.il
try to check if the array is bigger then -1 thing that mean the array 
isnt empty.
if ($obj->method<-1) {...;}

More information about the Perl mailing list