Subject: | Crashes on a specific bit of code in a block |
Running perlcritic on this code:'
END { $dbh->do("DROP TABLE $_") foreach @table }
Crashes with this error:
Fatal error while critiquing "foo.pl": Can't call method "isa" without a package or object reference at /var/perl5.20.3/lib/site_perl/5.20.3/Perl/Critic/Policy/Variables/ProhibitLoopOnHash.pm line 58.
The code reduces down to this that causes a crash:
{ print foreach @y }
This does NOT crash:
{ print foreach 1..2 }
Nor does:
{ print foreach @y; }
Nor does:
{ print }
Nor does:
print foreach @y;