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
|
|---|