Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^3: How to interpolate CONSTANTS in Here docs?

by Anonymous Monk
on Feb 11, 2015 at 22:49 UTC ( #1116405=note: print w/replies, xml ) Need Help??

in reply to Re^2: How to interpolate CONSTANTS in Here docs?
in thread How to interpolate CONSTANTS in Here docs?

[...] 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).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1116405]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2020-04-01 06:13 GMT
Find Nodes?
    Voting Booth?
    To "Disagree to disagree" means to:

    Results (186 votes). Check out past polls.