BeneSphinx has asked for the wisdom of the Perl Monks concerning the following question:
I was reading the Perl docs on heredoc just now, and found one description that I found very confusing. I'm hoping you can help me understand what's being described here: http://perldoc.perl.org/perlop.html#Quote-Like-Operators
Specifically, this part:
If you use a here-doc within a delimited construct, such as in s///eg, the quoted material must come on the lines following the final delimiter. So instead of
you have to writes/this/<<E . 'that' the other E . 'more '/eg;s/this/<<E . 'that' . 'more '/eg; the other E
I understand the part about placing the heredoc after the s// construct, but the substitution itself is confusing. Does it mean the same as this?
I guess I'm wrong to assume those periods are concatenation operators, but if so, what's going on here? What's the use case?s/this/the other\nthatmore /eg;
Thanks very much in advance!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: heredoc within a delimited construct
by jwkrahn (Abbot) on Feb 19, 2013 at 03:42 UTC | |
|
Re: heredoc within a delimited construct
by LanX (Saint) on Feb 19, 2013 at 00:26 UTC |