BrowserUk has asked for the wisdom of the Perl Monks concerning the following question:
Try and guess the output of the following one-liners before trying them.
perl -wMstrict -e"if( my($test) = 0 ) { print 'Passed'; } else { print + 'Failed'; }" perl -wMstrict -e"if( my($test) = '' ) { print 'Passed'; } else { prin +t 'Failed'; }" perl -wMstrict -e"if( my($test) = undef ) { print 'Passed'; } else { p +rint 'Failed'; }"
Does this consistute a bug?
Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
Back to
Seekers of Perl Wisdom