in reply to Re: Re: Location of 'use' statements
in thread Location of 'use' statements
The problem with "use constant" is that the constants are implemented as subroutines. This means that they break (silently) if you try to use them as hash keys, in double-quoted strings, or any other place where barewords are not interpreted as sub calls.
If you use global variables instead, everyone knows what they are and you avoid these bugs which tend to catch every user of constant at least once.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Re: Location of 'use' statements
by demerphq (Chancellor) on Apr 19, 2003 at 17:41 UTC |
In Section
Seekers of Perl Wisdom