sub map_constant_name { my ($name) = @_ ; # Let's not eval anything other than a simple name ! if ($name !~ /^\w+$/) { $@ = "will not map '$name'" ; return undef ; } ; # OK -- eval to try to get constant value my $val = eval "$name()" ; return $@ ? undef : $val ; } ;