Subject: | RequireLocalizedPunctuationVars exempt $? |
Date: | Sun, 22 May 2011 09:08:58 +1000 |
To: | bug-Perl-Critic [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
In the current cvs, running
perlcritic -s RequireLocalizedPunctuationVars
on
END {
$? = 13;
}
gives
Magic variable "$?" should be assigned as "local"
$? = 13;
Where I hoped that it would recognise an assignment to $? in an END
block is normal and specifically recommended in perlvar.pod.
I would go further and exempt $? completely, no matter where assigned.
It's an "output" variable, set by backticks etc, and anyone assigning is
probably establishing a value in that style for the caller to look at.
For example IPC::Run or Capture::Tiny, and even something in
Test::Builder finalize() maybe.