Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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 making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2020-10-21 17:02 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (222 votes). Check out past polls.