Alex Rivera | Logout

What is print <<EOF; and how is it working?

Asked 2012-08-14T08:16:33.347
11

Possible Duplicate:
Help me understand this Perl statement with <<'ESQ'

What is the statement in https://stackoverflow.com/questions/4151279/perl-print-eof doing exactly? I came across the previous post but didn't understand what he is trying to explain. What is that PETE? Can anyone explain every line? How is the code is working?

print <<EOF;
This is
a multiline
string
EOF

print <<PETE;
This is
a multiline
string
PETE

What is the difference and similarity between these two? In place of PETE I have used many other words like DOG and it works the same every time.

Edit
Report

1 Answer

11

See Quote and Quote-like Operators (it's pretty well explained).

answered 2012-08-14T08:21:38.343

Your Answer