Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
And from a golf field again. I like to omit parentheses with built-ins, but:
>perl -Mstrict -Mautodie -wE "my $s='.'; opendir my $h, $s # ok" >perl -Mstrict -Mautodie -wE "my $s='.'; opendir(my $h, $s); # ok" >perl -Mstrict -Mautodie -wE "my $s='.'; opendir my ($h), $s; # ok" >perl -Mstrict -Mautodie -wE "my $s='.'; opendir my $h, $s; # not ok" Parentheses missing around "my" list at -e line 1. >perl -Mstrict -Mautodie -wE "my $s='.'; opendir my $h, $s or bang(); +# ok" >perl -Mstrict -Mautodie -wE "my $s='.'; (opendir my $h, $s); # ok"
(Don't care if bang doesn't exist because of autodie in this case). A bug?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Semicolon terminating paren-less call to 'opendir' triggers a bogus warning
by LanX (Saint) on Sep 07, 2023 at 23:06 UTC | |
by BillKSmith (Monsignor) on Sep 08, 2023 at 02:04 UTC | |
by LanX (Saint) on Sep 08, 2023 at 07:12 UTC |