in reply to Alternative to "use constant" in multiple subroutines
If you find you absolutely must use the same constant name twice for different values, you kinda have two options:
use constant FOO => [qw(a b c)]; use constant FIRST => (0); use constant SECOND => (1); print FOO->[FIRST], $/; print FOO->[SECOND], $/;
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Alternative to "use constant" in multiple subroutines
by reds (Novice) on May 01, 2003 at 21:26 UTC | |
by dragonchild (Archbishop) on May 01, 2003 at 21:34 UTC | |
by reds (Novice) on May 01, 2003 at 21:57 UTC |