in reply to Re: Can't understand function returning undefs
in thread Can't understand function returning undefs
This prints OK3. According to the above, it should also print OK2 because (undef, undef) is a list of two elements that evaluates to 2 in scalar context. Still, it doesn't.if(undef, undef){ print "OK1\n"; } if( (undef, undef) ){ print "OK2\n"; } my @a = (undef, undef); if(@a){ print "OK3\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Can't understand function returning undefs
by JavaFan (Canon) on Sep 24, 2010 at 21:57 UTC | |
by ikegami (Patriarch) on Sep 24, 2010 at 22:03 UTC |