>>>>> "Jeffrey" == Jeffrey Baker <[EMAIL PROTECTED]> writes:

Jeffrey> Yeah.  I guess the reason I do the latter is b/c I want the code to
Jeffrey> reflect what I am actually trying to test.  I don't really want to test
Jeffrey> the trueness of @foo, I want to test for it's existence.  But in perl
Jeffrey> the operation is overloaded.  Feh.

Jeffrey> I think I will test for defined $foo_in[0] instead.

"if (@foo) {...}" is *idiomatic* Perl for "are there any elements in
@foo, and if so, do this".  If you don't understand the idioms, please
choose a more familiar language. :)

defined @bar and defined %bletch are almost never correct, and any
seasoned Perl hacker knows to watch for those as a red flag.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Reply via email to