in reply to Re: What is the difference between the constant construct in Perl and the Readonly construct in Perl?
in thread What is the difference between the constant construct in Perl and the Readonly construct in Perl?

I agree. that was one of the few things I didn't like while reading PBP.
To many people speed doesn't seem to be important. But if I hadn't used constant in my HTC module, it would probably be much slower than it is (I use a lot of constants there...)
and I think at least in modules speed is a bit more important than in application code.
  • Comment on Re^2: What is the difference between the constant construct in Perl and the Readonly construct in Perl?
  • Download Code

Replies are listed 'Best First'.
Re^3: What is the difference between the constant construct in Perl and the Readonly construct in Perl?
by Argel (Prior) on Jul 07, 2006 at 19:30 UTC
    From PBP page 58:
    If you decide not [to] use the Readonly module in production code (for performance or political reasons), then using constant is still better than using literal values.

    From that quote I get the impression that TheDamian is aware of the performance issues but takes for granted that others are not as familiar. Regardless however, the performance issue is mentioned in PBP (albeit briefly).

    Update: Fixed typos