in reply to Constants refferences
For interpolation.
For strings, perl will only interpolate variables starting with $ or @. So you need that. But ${} will dereference, so you need to take a reference. Really, this is a limitation of the constant module in creating constants that aren't usable everywhere that variables are. See Readonly for a slower alternative that interpolates properly.
For arrays, ARRAY_REF really returns a reference already, so when you dereference with @{}, it's already set. However, Perl may be getting confused as to whether ARRAY_REF is the name of your variable or a function or ... so the + disambiguates this. You could just as easily use @{ARRAY_REF()}, again, because ARRAY_REF really is a function call.
Generally, I haven't found much need for constant - I've found that constants aren't and variables don't, so why bother. :-P
|
|---|