Welcome to the Monastery | |
PerlMonks |
Re^3: How to interpolate CONSTANTS in Here docs?by Anonymous Monk |
on Feb 11, 2015 at 22:49 UTC ( [id://1116405]=note: print w/replies, xml ) | Need Help?? |
[...] builds a reference to an anonymous array, which is in turn de-referenced by @{...}. It's roundabout, but necessary in this case because the constants built by constant are actually functions, like sub OUT_DIR () { 'out' }, and a function call like OUT_DIR() (or OUT_DIR) isn't interpolated in strings, while scalars ($foo) and arrays (@bar) are, including dereferenced arrayrefs (@{$arrayref} - see e.g. Using References).
In Section
Seekers of Perl Wisdom
|
|