If you have a bareword between ${}, or a literal string, that's taken as the name of a variable ("${STRING}" is the same as "$STRING").
It appears to be more complicated than that:
gives:use strict ; use warnings ; my $x = 57 ; print "\${x} = '", ${x}, "'\n" ; print "\${'x'} = '", ${'x'}, "'\n" ;
Turning off "strict refs" gives:${x} = '57' Can't use string ("x") as a SCALAR ref while "strict refs" in use .. +.
Replacing my $x by our $x, gives:${x} = '57' Use of uninitialized value in print ... ${'x'} = ''
The interpretation of the bareword case doesn't look desperately useful to me... Anybody know why Perl doesn't treat it as a subroutine/constant ?${x} = '57' ${'x'} = '57'
Sadly, this wouldn't help "${CONSTANT}" but it would mean that @{REF_ARRAY_CONSTANT} would do what might be expected.
In reply to Re^2: Constants refferences
by gone2015
in thread Constants refferences
by leonidlm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |