in reply to Constants refferences
The short answer is that ARRAY_REF is a reference and STRING is not.
What you put between ${} or @{} needs to be a reference. By itself, STRING is not a reference—it's just a string. To get a reference to that string, use the backslash. Hence: "${\STRING}". It's the same as "${\'.+?'}".
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"). If you're using strict, then that's going to bomb (unless that variable's been declared somewhere).
ARRAY_REF is already a reference, so you don't have to backslash it. You do, however, have to keep "@{ARRAY_REF}" from being interpreted as "@ARRAY_REF", and so the "+" is there to mark it as an expression and not just a bareword.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Constants refferences
by gone2015 (Deacon) on Aug 21, 2008 at 17:28 UTC | |
by Anonymous Monk on Aug 22, 2008 at 07:16 UTC |