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

Viewed 46576

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.

2 Answers
Related