Subject: | ProhibitCallsToUndeclaredSubs vs more than two imports |
Date: | Sat, 16 Oct 2010 11:30:44 +1100 |
To: | bug-Perl-Critic-StricterSubs [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
If an import list has three or more literal strings only the first and
last seem to be used,
use Some::Thing 'foo', 'bar', 'quux', 'xyzzy';
my $w = foo(123);
my $x = bar(123);
my $y = quux(123);
my $z = xyzzy(123);
reports
foo.pl:3:9:
Perl::Critic::Policy::Subroutines::ProhibitCallsToUndeclaredSubs
Subroutine "bar" is neither declared nor explicitly imported
my $x = bar(123);
foo.pl:4:9:
Perl::Critic::Policy::Subroutines::ProhibitCallsToUndeclaredSubs
Subroutine "quux" is neither declared nor explicitly imported
my $y = quux(123);
where I expected no reports.
I wonder if _get_imports_from_use_statements() ``@schildren[2,-2]''
should be a range instead of just the 2 and -2 elements.