Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: here-document without interpolation (<<DELIMITER;)

by Coruscate (Sexton)
on Jan 16, 2004 at 05:35 UTC ( [id://321743]=note: print w/replies, xml ) Need Help??


in reply to here-document without interpolation (<<DELIMITER;)

Heredocs allow you to use a single blank line as your end delimeter if you wish. This means that rather than writing

print <<"Done"; foo bar baz Done print "aha!\n";

, you can write

print <<""; foo bar baz print "aha!\n";

(note the lack of anything but a blank line between "baz" and the following print statement). It was previously allowed to use

print <<; foo bar baz print "aha!\n";

(note the plain and simple "print <<;" line). You can still use that simple version, but it's best not to as there is no guarantee that such functionality will be reserved in future perl versions (and that is why the warnings pragma will cough up that deprecated message if you use "print <<;").

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-24 07:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found