Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How to interpolate CONSTANTS in Here docs?

by AnomalousMonk (Archbishop)
on Feb 11, 2015 at 21:49 UTC ( [id://1116400]=note: print w/replies, xml ) Need Help??


in reply to How to interpolate CONSTANTS in Here docs?

Interpolation rules for here-docs are the same as for double- and single-quoted strings (double in the OPed example), so one way:

c:\@Work\Perl>perl -wMstrict -le "use constant OUT_SUFXSTOR => 'storable'; ;; my $str = qq{The file suffix is ${ \ OUT_SUFXSTOR}.}; print qq{'$str'}; " 'The file suffix is storable.'

Update: Then there's also:

c:\@Work\Perl>perl -wMstrict -le "use constant OUT_SUFXSTOR => 'storable'; ;; my $str = qq{The file suffix is @{[ OUT_SUFXSTOR ]}.}; print qq{'$str'}; " 'The file suffix is storable.'


Give a man a fish:  <%-(-(-(-<

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (9)
As of 2024-03-28 09:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found