Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: How to interpolate CONSTANTS in Here docs?

by AnomalousMonk (Bishop)
on Feb 11, 2015 at 21:49 UTC ( #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
Node Status?
node history
Node Type: note [id://1116400]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2020-03-29 19:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    To "Disagree to disagree" means to:









    Results (171 votes). Check out past polls.

    Notices?