samtregar has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Is it possible to distinguish contstants from normal subs?
by merlyn (Sage) on May 19, 2002 at 02:01 UTC | |
by ariels (Curate) on May 19, 2002 at 06:39 UTC | |
by samtregar (Abbot) on May 19, 2002 at 04:09 UTC | |
by chromatic (Archbishop) on May 19, 2002 at 04:44 UTC | |
by samtregar (Abbot) on May 19, 2002 at 05:00 UTC | |
|
Re: Is it possible to distinguish contstants from normal subs?
by samtregar (Abbot) on May 19, 2002 at 04:58 UTC | |
by samtregar (Abbot) on May 19, 2002 at 06:16 UTC |