- or download this
our @GLOBAL_SYMBOLS; # these are not package constants, but Perl artif
+acts
BEGIN {
@GLOBAL_SYMBOLS = qw(BEGIN EXPORT);
}
- or download this
sub is_constant {
my $k = shift;
return $k =~ /^[A-Z]+$/
&& !grep { $_ eq $k } @GLOBAL_SYMBOLS
}
- or download this
our %GLOBAL_SYMBOL; # these are not package constants, but Perl artifa
+cts
BEGIN {
%GLOBAL_SYMBOL = map { $_ => 1 } qw(BEGIN EXPORT ISA EXPORT_OK GLO
+BAL_SYMBOL);
}
- or download this
sub is_constant {
my $k = shift;
return $k =~ /^[A-Z_0-9]+$/
&& !$GLOBAL_SYMBOL{$k};
}