[Israel.pm] Testing for non-empty array

Shlomi Fish shlomif at iglu.org.il
Sun Apr 10 22:17:19 PDT 2005


On Monday 11 April 2005 04:11, 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)?

What's wrong with:

	if ((my @temp = $obj->method()) > 0)

Or

	if ((my @temp = $obj->method()) == 0)

Regards,

	Shlomi Fish

> 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
> http://perl.org.il/mailman/listinfo/perl

-- 

---------------------------------------------------------------------
Shlomi Fish      shlomif at iglu.org.il
Homepage:        http://www.shlomifish.org/

Hacker sees bug. Hacker fixes bug.



More information about the Perl mailing list