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 )
)