hmmm.. what am I doing wrong here? (perl, v5.8.0 built for i686-linux)
]$ perl -wMstrict -e"if( my($test) = 0 ) { print 'Passed'; } else { pr +int 'Failed'; }" Can't declare stub in "my" at -e line 1, near ") =" Execution of -e aborted due to compilation errors. ]$ perl -wMstrict -e"if( my($test) = '' ) { print 'Passed'; } else { p +rint 'Failed'; }" Can't declare stub in "my" at -e line 1, near ") =" Execution of -e aborted due to compilation errors. ]$ perl -wMstrict -e"if( my($test) = undef ) { print 'Passed'; } else +{ print 'Failed'; }" Can't declare stub in "my" at -e line 1, near ") =" Execution of -e aborted due to compilation errors. ]$ perl -wMstrict -e "if( my $test = undef ) { print 'Passed'; } else +{ print 'Failed'; }" syntax error at -e line 1, near "my =" Execution of -e aborted due to compilation errors.
I had to swap "/' to get it to run..
]$ perl -wMstrict -e 'if( my ($test) = undef ) { print "Passed"; } els +e { print "Failed"; }' Passed ]$ perl -wMstrict -e 'if( my $test = undef ) { print "Passed"; } else +{ print "Failed"; }' Failed
cheers,
J
In reply to Re: Can you guess the result? Is it a bug?
by edoc
in thread Can you guess the result? Is it a bug?
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |