Perl Monk, Perl Meditation | |
PerlMonks |
Re: quotes in Perl (opinionated note on coding style)by dimar (Curate) |
on Feb 09, 2005 at 18:04 UTC ( [id://429444]=note: print w/replies, xml ) | Need Help?? |
The use of here documents is particularly useful ... because it allows you to keep the markup relatively free of escape characters that would otherwise reduce ... readability (opinionated note on coding style, your preference may vary) The HERE doc syntax was once a favorite here, but now it has been completely abandoned because:
Because of these issues, we made a stylistic decision not to use HERE doc syntax anymore, and instead use the very flexible quotelike operator with all variables 'concatenated in' instead. Thus, your example would become:
All you have to worry about is to make sure your quotelike delim character (caret) is never used in the document. If it is, just change it to something else. Moreover, you can indent this however you want without external module dependencies. Here, we just use comments to make the document visually distinct from the rest of the script.
In Section
Tutorials
|
|