develooper Front page | perl.perl5.porters | Postings from February 2011

Suggestion for adding to perlfaq4: here documents cannot end on the last line of a file

Thread Next
From:
Wim De Saegher
Date:
February 28, 2011 00:28
Subject:
Suggestion for adding to perlfaq4: here documents cannot end on the last line of a file
Message ID:
2217641232D84A2A9ED511A374E4B765@WimHP
Hello Perl5-porters,

recently someone on Stackoverflow asked where his here-document was not 
working: 
http://stackoverflow.com/questions/5136710/perl-here-document-not-working/

When given the answer, he complained it was not in the perldoc perlop. I 
pointed out it was, but he suggestion it be added to the 3 bullet-points in 
the perlfaq about here documents as well. This seemed like a valid 
suggestion to me:

http://perldoc.perl.org/perlfaq4.html#Why-don't-my-%3c%3cHERE-documents-work%3f

Right now this section has 3 bulletpoints:
 * There must be no space after the << part.
 * There (probably) should be a semicolon at the end.
 * You can't (easily) have any space in front of the tag.

It would be easy to add a fourth:
 * The heredoc can't end on the last line of your file. Add an empty line, 
or a comment or something else. 


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About