Hi,
I have a snippet of code as below.
Even when I return 0 or '', why does @blocks evaluate to true?
If rows returned are 0, then if(@blocks) should evaluate to false, correct?
Thanks,
Radhika
---
use strict;
use diagnostics;
my @blocks = ();
sub do_something
{
        my @row = @_;
        return @row if(@row);
        return '';
}
@blocks = do_something();
if([EMAIL PROTECTED])
{
        print("Got this number: @blocks\n");
}
else
{
        print("Got nothing\n");
}




-- 
It is all a matter of perspective. You choose your view by choosing where
to stand.
Larry Wall
---

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to