in reply to Re: Re: Behavior of compile-time constants?
in thread Behavior of compile-time constants?

Since all use constant does is creating such subs, I wonder why you dislike the constant module.

Abigail, author of the variable pragma.

Replies are listed 'Best First'.
Re: Re: Behavior of compile-time constants?
by particle (Vicar) on Jun 14, 2002 at 18:33 UTC
    i dislike the syntax... i don't think => looks like assignment. also, it creates a sub with an empty prototype behind the scenes, so why introduce the overhead for a syntax i don't agree with? i don't see what it gets me.

    the use of subroutines with empty prototypes as inlinable is well documented in perlsub, and i expect anyone maintaining my code is familiar with this doc.

    ~Particle *accelerates*

      I wouldn't worry about the overhead of 70 lines of code and one function call per constant, unless you're writing a very very small program. If the manpage syntax is really a problem, why not use a skinny comma?
      use constant 'FOO', 2;