Think about Loose Coupling | |
PerlMonks |
Re: Variable assignment after logical ORby johngg (Canon) |
on Oct 02, 2007 at 19:08 UTC ( [id://642209]=note: print w/replies, xml ) | Need Help?? |
snopal has pointed you towards using or instead of || because the former is a lower-precedence equivalent of the latter. Another way to solve your problem would be to use parentheses with your open so the || doesn't bind the file name and the flag together.
It is often recommended these days to use the three-argument form of open with lexical filehandles, like this.
Cheers, JohnGG Update: I really must learn to type faster :(
In Section
Seekers of Perl Wisdom
|
|