Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by Coruscate (Sexton)
on Jan 16, 2004 at 05:35 UTC ( #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
Node Status?
node history
Node Type: note [id://321743]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2020-12-01 00:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?