in reply to Re: what's wrong with this?
in thread what's wrong with this?

The || operator has higher precedence than the = operator so you need to either enclose the assignment in parentheses or use the lower precedence or operator.
No cigar for you :)
C:\>perl -MO=Deparse,-p -e" my $foo = shift || die 666;" (my $foo = (shift(@ARGV) || die(666))); -e syntax OK C:\>perl -MO=Deparse,-p -e" my $foo = shift or die 666;" ((my $foo = shift(@ARGV)) or die(666)); -e syntax OK C:\>perl -e" my $foo = shift || die 666;" 666 at -e line 1. C:\>perl -e" my $foo = shift or die 666;" 666 at -e line 1. C:\>
Perl Idioms Explained - && and || "Short Circuit" operators
To || or not to or and why.
|| die or or die :)
"or" or "||" problems
or vs || precedence issue