Don't ask to ask, just ask | |
PerlMonks |
Re^2: Variable assignment after logical ORby jwkrahn (Abbot) |
on Oct 02, 2007 at 20:03 UTC ( [id://642229]=note: print w/replies, xml ) | Need Help?? |
In your open statement, || is evaluated before the comma, so your statement is parsed as open FILE, (">test.txt" || $failed_flag = 1); giving the syntax error. Actually the || operator also has higher precedence than the = operator so it is parsed as open FILE, (">test.txt" || $failed_flag) = 1; which is why you get the error Can't modify constant item in scalar assignment
In Section
Seekers of Perl Wisdom
|
|