Hello everyone,
After months of searching perl documentation and books,
I finally found out what those "<<" are called.
What's strange is that I found my answer in a PHP book!

Having seen heredocs in a php script first,
I find Perl's syntax very confusing.

The following works as a php script but not as a perl script (removed <?php and ?>):

print <<<HTML
<head>
<title>heredoc demo</title>
</head>
HTML;

From the sparse examples that I could find with heredocs and perl, the former php script
finally becomes a perl script:


print <<HTML;
<head>
<title>heredoc demo</title>
</head>
HTML

...onto the questions:
1.) What's up with the semicolon at the end of the first delimiter? I find that confusing.
2.) No documentation was found for [perldoc heredoc] and [perldoc heredocs],
where is the documentation or examples that illustrate how to use heredocs in perl?
3.) How are heredocs stored in variables?


Thanks in advance.
-gohaku


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




Reply via email to