use constant foo => 1; sub bar { $_[0] } print "ok\n" if is_constant('main::foo'); print "ok\n" unless is_constant('main::bar');
One possibility would be to override constant::import, but that has a number of drawbacks and wouldn't catch "home-grown" constant subs.
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |