Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by BrowserUk (Patriarch)
on Feb 11, 2015 at 23:16 UTC ( [id://1116406]=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?

Anonymonk has explained the syntax; but I thought I'd add that I'm not keen on doing it that way. Personally I prefer:

#! perl -slw use strict; use constant { OUT_DIR => 'out', OUT_FIELDSEP => '=', OUT_FILENAME => 'ks', OUT_SUFXSTOR => 'storable', VAL_MIN => 15, VAL_MAX => 3600, }; printf <<USAGE, OUT_DIR, OUT_FILENAME, OUT_SUFXSTOR, OUT_FIELDSEP, VAL +_MIN, VAL_MAX; This program does this and that with the %s. The filename is %s and the file suffix is %s. Fields are separated with the %s character. Enter a value between %s and %s. USAGE

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-25 19:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found