The code bellow was working fine until I changed something by mistake and suddenly it says only this when I try to run it:
Warning: Content-Type header not found in the script output. If this script is not a CGI one, please use the Run -> Run in Command Prompt menu to run it.
Execution of index.pl aborted due to compilation errors
So I did a "syntax check" on it and can't work out where the syntax error is. The results from the syntax check are:
Missing right curly or square bracket at index.pl line 150, at end of line
(Might be a runaway multi-line << string starting on line 136)
syntax error at index.pl line 150, at EOF
index.pl had compilation errors.
Please help as I have spent ages trying to wprk out where the error is but really can't! Its probably really simple.
-Ed ;-)
Warning: Content-Type header not found in the script output. If this script is not a CGI one, please use the Run -> Run in Command Prompt menu to run it.
Execution of index.pl aborted due to compilation errors
So I did a "syntax check" on it and can't work out where the syntax error is. The results from the syntax check are:
Missing right curly or square bracket at index.pl line 150, at end of line
(Might be a runaway multi-line << string starting on line 136)
syntax error at index.pl line 150, at EOF
index.pl had compilation errors.
Please help as I have spent ages trying to wprk out where the error is but really can't! Its probably really simple.
Code:
#!/usr/bin/perl
use CGI;
require ('../usefulSubs.pl');
#### Prepare table format ####
$tableHighlighted = <<'SINGLE_QUOTES';
<TR>
<TD width="80" background="../images/tableFadeLeft.gif">
¦tableDate¦
<TD width="350" bgcolor="#FFFFFF">
¦tableTitle¦
<TD width="200" background="../images/tableFadeRight.gif">
¦tableCatagories¦
SINGLE_QUOTES
$tableNormal = <<'SINGLE_QUOTES';
<TR>
<TD>
¦tableDate¦
<TD>
¦tableTitle¦
<TD>
¦tableCatagories¦
SINGLE_QUOTES
#### Read in dreams ####
foreach $entry (getDir('leesDreams'))
{
if (fromLast('.', $entry) eq 'ftm')
{
$dateofDream = uptoFirst('_', $entry);
push (@tableOfDreams, forge($dateofDream, "\n", getFile("leesDreams/$entry")));
}
}
#### See which dream to go from and prepare table data ####
$dreamsFrom = getCookie('dreamsFrom');
if (!$dreamsFrom) {$dreamsFrom = 1;}
$rowType = "highlighted";
foreach $dream ("<B>Date:</B>\n<B>Title:</B>\n<B>Categories:</B>", @tableOfDreams)
{
@dataCells = split("\n", $dream);
$tableDate = shift(@dataCells);
$tableTitle = shift(@dataCells);
$tableCatagories = shift(@dataCells);
$dreamNumber++;
if ($dreamNumber >= $dreamsFrom && $dreamNumber <= $dreamsFrom+17)
{
if ($rowType eq "highlighted")
{
$tableData = forge($tableData, replaceVars($tableHighlighted));
$rowType = "normal";
}
else
{
$tableData = forge($tableData, replaceVars($tableNormal));
$rowType = "highlighted";
}
}
}
#### Prepare option menu ####
$topPart = <<'SINGLE_QUOTES';
<FORM name="form¦formNum¦" onSubmit="document.location='index.stm?'+form¦formNum¦.viewDream.value; return false;">
View:
<SELECT name="whichDreams">
<OPTION>Lee's Dreams</OPTION>
<OPTION>Guests' Dreams</OPTION>
<OPTION>All Dreams</OPTION>
</SELECT>
Sort by:
<SELECT name="sortBy">
<OPTION>Newest First</OPTION>
<OPTION>Oldest First</OPTION>
<OPTION>A - Z</OPTION>
<OPTION>Z - A</OPTION>
</SELECT>
Catagory:
<SELECT name="catagory">
<OPTION>All Categories</OPTION>
<OPTION>Friends</OPTION>
<OPTION>Trapped</OPTION>
<OPTION>School</OPTION>
<OPTION>Jumping</OPTION>
<OPTION>Imagination</OPTION>
<OPTION>Hovering</OPTION>
<OPTION>Woodcraft</OPTION>
<OPTION>Cannabis</OPTION>
<OPTION>Claustraphobia</OPTION>
</SELECT>
SINGLE_QUOTES
#### Prepare navigator ####
if ($dreamsFrom != 1)
{
$previousPage = <<'SINGLE_QUOTES';
<A href="." onclick="viewDreamsFrom(18);">
<< Previous Page
</A>
SINGLE_QUOTES
}
if ($dreamsFrom > @tableOfDreams)
{
$nextPage = <<'SINGLE_QUOTES';
<A href="index.stm?3">
Next Page >>
</A>
SINGLE_QUOTES
}
$navigator = <<'SINGLE_QUOTES';
¦previousPage¦
¦nextPage¦
SINGLE_QUOTES
$formNum = 2; $bottomPart = replaceVars(forge('<BR>', $navigator, '<BR><BR>', $topPart, '</FORM><BR>'));
$formNum = 1; $topPart = replaceVars(forge('<BR>', $topPart, '<BR><BR>', $navigator, '</FORM>'));
#### Print it all ####
print <<DOUBLE_QUOTES;
<CENTER>
<SCRIPT language="javaScript">
function viewDreamsFrom(dreamsFrom)
{
document.cookie='dreamsFrom=' + dreamsFrom + ';path=/';
}
</SCRIPT>
$topPart
<TABLE cellpadding="5" cellspacing="0" border="0" style="width:630px">
$tableData
</TABLE>
$bottomPart
</CENTER>
DOUBLE_QUOTES
-Ed ;-)
________________________________
Destiny is not a matter of chance; it is a matter of choice.
Destiny is not a matter of chance; it is a matter of choice.