in reply to Re: Can you guess the result? Is it a bug?
in thread Can you guess the result? Is it a bug?
Because $test is in double-quotes, your shell is trying to interpolate it. Since it isn't set though (and there aren't such things as warnings and strict for the shell ; ), it is replaced with nothing and becomes:
If you escape the $ you'll be fine.perl -wMstrict -e"if( my() = 0 ) { print 'Passed'; } else { print 'Fai +led'; }"
perl -wMstrict -e"if( my(\$test) = 0 ) { print 'Passed'; } else { prin +t 'Failed'; }"
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Can you guess the result? Is it a bug?
by Cine (Friar) on Jul 31, 2003 at 13:31 UTC |
In Section
Seekers of Perl Wisdom