From: Anno Siegel (via RT) <perlbug-followup@perl.org>
Message-ID: <rt-3.0.11-32400-100099.4.
31094423840584@perl.org>
p4raw-id: //depot/perl@23497
use warnings::register;
our($VERSION, %declared);
-$VERSION = '1.04';
+$VERSION = '1.05';
#=======================================================================
} elsif ($forced_into_main{$name}) {
warnings::warn("Constant name '$name' is " .
"forced into package main::");
- } else {
- # Catch-all - what did I miss? If you get this error,
- # please let me know what your constant's name was.
- # Write to <rootbeer@redcat.com>. Thanks!
- warnings::warn("Constant name '$name' has unknown problems");
}
}
use strict;
-use Test::More tests => 74;
+use Test::More tests => 75;
my $TB = Test::More->builder;
BEGIN { use_ok('constant'); }
is FAMILY->[2], RFAM->[0]->[2];
is AGES->{FAMILY->[1]}, 28;
is THREE**3, SPIT->(@{+FAMILY}**3);
+
+# Allow name of digits/underscores only if it begins with underscore
+{
+ use warnings FATAL => 'constant';
+ eval q{
+ use constant _1_2_3 => 'allowed';
+ };
+ ok( $@ eq '' );
+}