Constants are transformed into subroutines (at least in some cases, I'm not too familiar with them at all).
Constants created with constant.pm are indeed subs (in all cases.) They are made by aliasing the constant's name to an anonymous sub with an empty prototype the body of which is simply the supplied value. The empty prototype is a hint to perl that the sub is a candidate for inlining. In other words, you could create your own "constants" with code like
if you wanted.sub MY_CONSTANT () { 42 }
-sauoq "My two cents aren't worth a dime.";
In reply to Re: Re: constants within regular expression?
by sauoq
in thread constants within regular expression?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |