loody wrote:
Dear all:
below is what I excerpt form "perl cook book".
What does <<"EOF" mean at the end of print?

It has nothing to do with the print() function. It's the beginning of a "here document".

http://perldoc.perl.org/perlop.html#%3c%3cEOF

open(SENDMAIL, "|/usr/sbin/sendmail -oi -t -odq")
or die "Can't fork for sendmail: $!\n";
print SENDMAIL <<"EOF";
From: Tom Christiansen <[EMAIL PROTECTED]>
To: Nathan Torkington <[EMAIL PROTECTED]>
Subject: Re: The Perl Cookbook
(1) We will never finish the book.
(2) No man who uses EMACS is deserving of love.
(3) I recommend coq au vi.
tom
EOF
close(SENDMAIL);

That example should really include a check of the return value of close(), since it's closing an opened pipe.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to