所以,这在两分钟前工作正常,由于某种原因它现在已经停止工作了。
#!/usr/bin/perl
# Dan Edwards
open (FILE, "donations.txt") || &ErrorMessage;
@filemessages = <FILE>;
close (FILE);
print <<EndHTML;
Content-type: text/html
<html>
<head>
<title>Teenage Cancer Research Charity Donations</title>
<link rel="stylesheet" type="text/css" href="sponsor.css\">
</head>\
<body >
<div id="container">
<div id="header">
<h1><center>Teenage Cancer Research</center></h1>
</div>
<div id="nav">
</div>
<div id="aside">
</div>
<div id="welcome">
<h1>Welcome to the Teenage Cancer Research Donations Page<h1>
</div>
<div id="donationsTable">
EndHTML
$n=0;
print "<UL><H2>Below are the Current Donations</H2></UL>";
foreach $message (@filemessages) {
print "<LI><I>$message</I>\n";
$n++;
}
print<<EndHTML;
<br>
<br>
<h1>Please dig deep and give whatever you can!</h1>
<br>
<a href="donate.html" class="button"/>SPONSOR ME!</a>
</div>
<br>
<br>
<br>
<div id="totalTable">
<table class="center" border="1">
<tr><th>Total Donated Online</th>
<td>£</td>
<th>Gift Aid Plus Supplement</th>
<td>£</td>
</tr>
</table>
</div>
<div id="footer">
Copyright © Teenage Cancer Research
</div>
</div>
</body>
</html>
EndHTML
找到该文件并打开该页面,但它以纯文本形式加载。我完全陷入困境,不知道该怎么做。
我是一个完整的Perl新手,我不知道为什么它不能正常工作
答案 0 :(得分:0)
您的错误在这里:
Content-type: text/html
<html>
Content-Type
后需要额外的一行。