Subject: | NamingConventions::Capitalization vs multi-constant |
Date: | Mon, 13 Apr 2009 08:53:49 +1000 |
To: | bug-Perl-Critic [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
With the current cvs I noticed with an input
use constant { ONE => 1,
TWO => 2 };
reports
Constant "{ ONE => 1,
TWO => 2 }" is not all upper case at line 1, column 5. See pages 45,46 of PBP. (Severity: 1)
where I hoped it would recognise "ONE" and "TWO" as ok (or failing that
recognise it's an expression rather than a bareword or string constant
and therefore can't be directly interpreted).
Index: Capitalization.run.PL
===================================================================
--- Capitalization.run.PL (revision 3219)
+++ Capitalization.run.PL (working copy)
@@ -164,6 +164,15 @@
my $foo = $condition ? $objection->method : $alternative;
my $foo = $condition ? undef : 1;
+#-----------------------------------------------------------------------------
+
+## name "use constant" multi-constant hash
+## failures 0
+## cut
+
+use constant { ONE => 1,
+ TWO => 2 };
+
END_SIMPLE_TESTS
return;