in reply to open and list context (?)

Its related to an old bug, #7250: Inappropriate warning for 'my' in 'open'
$ perl -we "$file='X'; open my $fh, $file;" Parentheses missing around "my" list at -e line 1. $ perl -we "$file='X'; open my($fh), $file;"
Once you get in the habbit of adding parens, you keep adding them (I know I do), even if you switch to 3 argument open which doesn't trigger the bug
$ perl -we "$file='X'; open my $fh, '<', $file;"

Replies are listed 'Best First'.
Re^2: open and list context (?)
by Anonymous Monk on Jun 17, 2011 at 15:04 UTC
    This is the correct answer. I do it out of habit without even thinking about it because of this old issue --brian d foy, who hasn't been able to login in ages since the password resetter thingy doesn't work.