http://www.perlmonks.org?node_id=1116400


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:  <%-(-(-(-<