On Tue, 7 Aug 2001 15:34:44 +0300 (EET DST), Ilmari Karonen wrote:

>The stable cases also correspond exactly to the behavior you would get
>if you defined your constants manually like this:
>
>  sub CONSTANT_A () { return (); }

Actually, if you look at the source for constant.pm, you see it acts
like

        *CONSTANT_A = sub () {};

which is basically the same thing.

(lines 89 through 97 in my copy, that came with 5.6.1)

BTW can anybody explain how the "magic" works? I mean: how comes that in

        use constant DEBUG => 0;
        if(DEBUG) {
              .... # things to do when debugging)
        }

that the if-block is supposed to be stripped from the compiled program,
as if DEBUG was replaced with a literal 0? Is the compiler so smart that
it recognizes a sub that returns a constant? It'd almost have to be that
way.

-- 
        Bart.

Reply via email to