diff options
Diffstat (limited to 'dist/constant/lib/constant.pm')
-rw-r--r-- | dist/constant/lib/constant.pm | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/dist/constant/lib/constant.pm b/dist/constant/lib/constant.pm index a51ee7f277..3ee1a6f5b0 100644 --- a/dist/constant/lib/constant.pm +++ b/dist/constant/lib/constant.pm @@ -4,7 +4,7 @@ use strict; use warnings::register; use vars qw($VERSION %declared); -$VERSION = '1.19'; +$VERSION = '1.20'; #======================================================================= @@ -60,15 +60,14 @@ sub import { } $constants = shift; } else { - $constants->{+shift} = undef; - } - - foreach my $name ( keys %$constants ) { - unless (defined $name) { + unless (defined $_[0]) { require Carp; Carp::croak("Can't use undef as constant name"); } + $constants->{+shift} = undef; + } + foreach my $name ( keys %$constants ) { # Normal constant name if ($name =~ $normal_constant_name and !$forbidden{$name}) { # Everything is okay |