needperlhelp has asked for the wisdom of the Perl Monks concerning the following question:
upon printing CONST_VAL1 , CONST_VAL2 , the values are printed,$test = 'value'; use constant CONST_VAL1 => $ENV{'PATH'}; # This works use constant CONST_VAL2 => scalar localtime # This works use constant CONST_VAL3 => $test ; # This doesn't work
2006-09-05 Retitled by holli, as per Monastery guidelines
Original title: 'constants :-('
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: problem with creating constants from scalar
by Fletch (Bishop) on Aug 30, 2006 at 03:38 UTC | |
by needperlhelp (Acolyte) on Aug 30, 2006 at 03:53 UTC | |
|
Re: problem with creating constants from scalar
by duff (Parson) on Aug 30, 2006 at 03:48 UTC |