Subject: | ProhibitCallsToUndeclaredSubs vs defined &foo |
Date: | Tue, 04 Aug 2009 11:44:00 +1000 |
To: | bug-Perl-Critic-StricterSubs [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
With the current cvs, a file foo.pl containing
defined &foo
reports
Subroutine "&foo" is neither declared nor explicitly imported
where I hoped it could recognise that as an existence test instead of a
call.
Testing your own package's funcs like that is a bit unusual, but I had
it in test scripts which look at the funcs exported (or not) by the
thing under test.
ProhibitAmpersandSigils has a similar check for defined &foo (with or
without parens like defined(&foo) etc). There may be an opportunity to
share code as to what's a test or a call.