以下是我用来将 HTML 页面作为分块响应发送的脚本的一部分。但是,在运行脚本时会引发编译错误,例如:
在 nph-99_1_1_18.pl 第 19 行,靠近“print”233“(可能是从第 18 行开始的失控的多行“”字符串)处找到操作员预期的数字
#! /usr/bin/perl
print "HTTP/1.1 200 OK\n";
print "Connection: Close\n";
print "Content-type:text/html\n" ;
print "Transfer-Encoding:chunked\n\n" ;
print "96\r\n";
print <<EndText;
<html>
<!-- this chunk is 150 bytes in length-->
<head>
<title>Document Title</title>
<link REL="StyleSheet" TYPE="text/css" HREF="example.css">
</head>
<body>
EndText
print "\r\n\";
print "233\r\n";
print <<EndText;
<!-- this chunk is 563 bytes in length-->
<h1 CLASS="funkyclass" ALIGN="center">Welcome to my home page!</h1>
<br><br>
<p>Hi there! If you are reading this then you have found my home page! Congratulations! I know it can be hard to find my pages, but I bet that you feel lucky now. Now that you are here, please take a look at my page of links to <a HREF="http://www.mysite.com/coolsites.html">cool sites</a> or sign my <a HREF="http://www.mysite.com/guestbook.html">guest book</a></p>
<div CLASS="foo"> My wonderful poetry <br> is available if you are REALLY bored. Why not give it a spin?</div>
EndText
print "\r\n\";