It's an inconsistency in Perl's implementation of that warning resulting from how Perl decides whether it's looking at a list or not. Strictly speaking the code is ambiguous; do you want my $this, $that, or open my ( $fh ), $filename? You know the answer, and Perl runs it right, but the warning is generated. It's documented here: https://rt.perl.org/rt3/Public/Bug/Display.html?id=7250. It's been around for awhile. You can always wrap parens around the my declaration, like this:
open my ( $fh ), $filename;It sometimes (maybe always) goes away if you put "or die $!;" after your open call, so it was less apparent before the days of autodie.
Dave
In reply to Re: Parentheses missing around "my" list
by davido
in thread Parentheses missing around "my" list
by rastoboy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |