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

People
Owner: Nobody in particular
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

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



Subject: RequireLocalizedPunctuationVars allow array $a[0]
Date: Mon, 13 Apr 2009 08:56:59 +1000
To: bug-Perl-Critic [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
It'd be good if RequireLocalizedPunctuationVars allowed an array use like $a[0], and not treat it the same as the plain scalar $a, per below. Except I'm not sure if "my @a" is a good idea. If not then the docs in RequireLocalizedPunctuationVars could helpfully note or cross-reference about that, to explain why the policy will trap all forms of a "punctuation" name.
Index: RequireLocalizedPunctuationVars.run.PL =================================================================== --- RequireLocalizedPunctuationVars.run.PL (revision 3285) +++ RequireLocalizedPunctuationVars.run.PL (working copy) @@ -334,6 +334,8 @@ sort { my @a = split m{,}xms, $a; my @b = split m{,}xms, $b; + $a[2] = 123; + $b[2] = 456; $a[0] cmp $b[0] || $a[1] <=> $b[1] } qw( b,6 c,3 ) )
Subject: Re: [rt.cpan.org #44988] RequireLocalizedPunctuationVars allow array $a[0]
Date: Sun, 12 Apr 2009 18:51:58 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
Kevin Ryde via RT wrote: Show quoted text
> It'd be good if RequireLocalizedPunctuationVars allowed an array use > like $a[0], and not treat it the same as the plain scalar $a, per below. > > Except I'm not sure if "my @a" is a good idea. If not then the docs in > RequireLocalizedPunctuationVars could helpfully note or cross-reference > about that, to explain why the policy will trap all forms of a > "punctuation" name.
Yeah, using any of the special variable names should be complained about no matter the sigil because they're all treated specially in that they're all put into main:: (well, the glob is. same thing). But, yes, documentation could be added.