in reply to Is there any difference between these two statement?
if (1 and ($result = (func($param))[0])) { print "1\n"; } else { print "0\n"; } print "$result\n"; sub func { return (0, 1, 2); }
Prints two 0's, which seems to be what is wanted here - and with syntax that makes more direct sense than form #1 (at least in my opinion).
|
|---|