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: 46727
Status: new
Priority: 0/
Queue: Perl-Critic

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

Bug Information
Severity: Unimportant
Broken in: 1.098
Fixed in: (no value)



Subject: RequireLocalizedPunctuationVars should not want to localize in top-level scope
Variables::RequireLocalizedPunctuationVars embodies page 81 of PBP, which suggests using 'local' on a punctuation variable before changing it, so that the change has as small a scope as possible. This is normally sound advice, but it does not make sense to 'local' at the top-level scope of the program. In short scripts you often might set $ENV{PATH} or other environment variables at the top-level scope. Since the top-level scope is never exited, the previous value of the variable will never be restored, and so adding 'local' to the assignment statement has no effect. The rule should have an exception for the top-level scope.