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 = @_;
On 1/25/06, radhika [EMAIL PROTECTED] wrote:
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 = ();
radhika wrote:
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?
...
sub do_something
{
my @row = @_;
return @row if(@row);
return '';
}
@blocks