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

Re: Here, doccy doccy. nice doccy. heredoc, treat.

by Abigail (Deacon)
on Jun 22, 2001 at 04:40 UTC ( #90597=note: print w/ replies, xml ) Need Help??


in reply to Here, doccy doccy. nice doccy. heredoc, treat.

Anything that allows for interpolated context (which means qq, qx and qr) can fairly easily be adapted to use here docs:

print `${\<<HERE}`; date HERE
or
print qx {${\<<HERE}}; date HERE
And for qx:
print qr /${\<<HERE}/; x*foo HERE
For q and qq, we already know what to do, single or double quote the delimeter. Which leaves us with qw, which is fairly simple too:
my @words = split ' ' => <<'HERE'; some words go here HERE

-- Abigail


Comment on Re: Here, doccy doccy. nice doccy. heredoc, treat.
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2014-12-26 04:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (165 votes), past polls