Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Perl-Critic CPAN distribution.

Report information
The Basics
Id: 29384
Status: resolved
Priority: 0/
Queue: Perl-Critic

People
Owner: Nobody in particular
Requestors: rt.cpan [...] sartak.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: RequireLocalizedPunctuationVars or similar should handle SIG
Hi, Perl::Critic::Policy::Variables::RequireLocalizedPunctuationVars should flag normal (non-localized) assignments to %SIG, especially $SIG{__DIE__}. Technically %SIG isn't a punctuation variable, but that should be OK. :) In the documentation it talks more about "magic" vars which %SIG certainly is. Thanks for the excellent set of modules. Shawn M Moore
From: cpan [...] chrisdolan.net
On Sat Sep 15 21:16:51 2007, SARTAK wrote: Show quoted text
> Hi, > > Perl::Critic::Policy::Variables::RequireLocalizedPunctuationVars should > flag normal (non-localized) assignments to %SIG, especially > $SIG{__DIE__}. > > Technically %SIG isn't a punctuation variable, but that should be > OK. :) In the documentation it talks more about "magic" vars which %SIG > certainly is. > > Thanks for the excellent set of modules. > > Shawn M Moore
Shawn, %SIG is a known limitation of that policy. We have a TODO test for $SIG{__DIE__}. I forgot to document that limitation in the POD, though. I'll fix that latter oversight immediately, but the fix for the bug will have to wait a bit. Chris
Fixed (I hope) in svn revision 3083. The fix was to back up over any PPI::Structure::Subscript objects found, and then analyze the first non-subscript found. With the change, the policy also flags $ENV{}, $INC[], and so on as violations. Configuration item 'exceptions' has been added for those who do not like the extra detected violations. The test was updated to remove the TODO and add tests for the newly-caught items, and the configuration variable. The t/10_user_profile.t mod fixes a violation caught by the revised module. I have also taken the liberty of naming the variable in the violation message.
This has been completed and released in Perl-Critic-1.097_002. http://search.cpan.org/~elliotjs/Perl-Critic-1.097_002 Thank you for submitting this ticket.