in reply to The name of a constant

Ahem
use constant FOO => "a string"; sub constant_name { return (grep { $_[0] eq (\&{$_})->() } keys %constant::declared)[0] =~ /::(.*?)\z/; } print constant_name(FOO);
So it can be done, but don't do it like that, best listen to BrowserUk and use a hash map instead.
HTH

_________
broquaint