in reply to Using constants. What am I doing wrong?
Others have told you why you get the result you get; here's a couple of ways to get around it:
# this: BEGIN { use vars '$Base'; $Base = 'mybase'; } use constant BASE => $Base; # or this: my $Base = 'mybase'; sub BASE () { $Base }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using constants. What am I doing wrong?
by dragonchild (Archbishop) on Feb 22, 2005 at 14:29 UTC | |
by saskaqueer (Friar) on Feb 23, 2005 at 06:54 UTC | |
|
Re^2: Using constants. What am I doing wrong?
by Random_Walk (Prior) on Feb 22, 2005 at 11:34 UTC |