in reply to Detecting 'our $foo => 1' mistake?
Hi perlancar,
Could you provide an SSCCE that demonstrates the problem? As the AM already pointed out, the code you showed does provide a warning:
$ perl -wMstrict -e 'our $foo => { a=>"blah", b=>"blah" };' Useless use of anonymous hash ({}) in void context at -e line 1.
Update: Ok, the code you showed in the title does not warn. Standard Perl::Critic doesn't seem to catch this one either, and I don't yet see any add-on policies that catch this. Update 2: See my other reply.
$ perl -wMstrict -e 'our $foo => 1;' $
Regards,
-- Hauke D
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Detecting 'our $foo => 1' mistake? (scalar comma evaluating to 1)
by LanX (Saint) on Jan 21, 2017 at 11:04 UTC | |
by haukex (Archbishop) on Jan 21, 2017 at 11:21 UTC | |
by LanX (Saint) on Jan 21, 2017 at 18:28 UTC | |
|
Re^2: Detecting 'our $foo => 1' mistake? (updated)
by ikegami (Patriarch) on Jan 23, 2017 at 17:14 UTC |