php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21191 Here Documents and EOF
Submitted: 2002-12-26 06:00 UTC Modified: 2002-12-26 06:04 UTC
From: neo_in_matrix at msn dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.2.3 OS: Windows XP Pro/SP1
Private report: No CVE-ID: None
 [2002-12-26 06:00 UTC] neo_in_matrix at msn dot com
#! c:/perl/bin/perl.exe -w
#
#########################

use strict;

#print "Content-Type:text/plain\n\n";

print <<"END";
A	B	C
DE	F
END^Z

If you have the above simple script file you won't get it run! Instead, you will get error:

Can't find string terminator "END" anywhere before EOF at C:\Perl\eg\test.pl line 9.

Why? Note that the file ends immediately after the last word 'END'. There is NO new line after it!

But, if you add a new line after 'END', the script runs well. That is:

#! c:/perl/bin/perl.exe -w
#
#########################

use strict;

#print "Content-Type:text/plain\n\n";

print <<"END";
A	B	C
DE	F
END
^Z

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-26 06:04 UTC] georg@php.net
rofl!
 [2002-12-26 06:04 UTC] sesser@php.net
We do not fix perl bugs.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 05:01:34 2025 UTC