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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: neo_in_matrix at msn dot com
New email:
PHP Version: OS:

 

 [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: Wed Jul 16 14:01:33 2025 UTC