Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: hiccoughing here documents

by AnomalousMonk (Archbishop)
on Aug 11, 2017 at 22:20 UTC ( [id://1197282]=note: print w/replies, xml ) Need Help??


in reply to hiccoughing here documents

Not very pretty IMHO, but maybe something like:

use warnings; use strict; my $n = 5; my $s = <<EOS; line 1 line two ${ \ join "\n", ("repeated line tres") x $n } line penultimate line the last EOS print "[[$s]]";
Output:
c:\@Work\Perl\monks\Anonymous Monk\1197277>perl hiccup_here_1.pl [[line 1 line two repeated line tres repeated line tres repeated line tres repeated line tres repeated line tres line penultimate line the last ]]
(The explicit join statement | expression could become a call to a function returning any string.)


Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-19 05:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found