T
TP
hi all
i get the message Cand find String Terminator "HTML_RESPONSE" anywhere
before line .... everytime i try to compile the script
can anyone tell me what is wrong with it ?
#!/usr/bin/perl
use CGI;
my($query);
$query = new CGI;
##Configuration section
$dbpath = 'db.txt';
$searchwhat = $query->param("searchwhat");
$searchkey = $query->param ("searchkey");
##end of configuration
#Begin search section
open (DB, "<$dbpath") or die ("$!\n");
while (<DB>){
if ($searchwhat eq "all"){
if (/$searchkey/i){
push @matches, $_
};
}
elsif ($searchwhat eq "mtype"){
($mtype, $mname, $mactor, $mactress, $mdes) = split (/\|/);
if ($mtype =~ /$searchkey/i){
push @matches, $_
};
}
elsif ($searchwhat eq "mname"){
($mtype, $mname, $mactor, $mactress, $mdes) = split (/\|/);
if ($mname =~ /$searchkey/i){
push @matches, $_
};
}
elsif ($searchwhat eq "mactor"){
($mtype, $mname, $mactor, $mactress, $mdes) = split (/\|/);
if ($mactor =~ /$searchkey/i){
push @matches, $_
};
}
elsif ($searchwhat eq "mactress"){
($mtype, $mname, $mactor, $mactress, $mdes) = split (/\|/);
if ($mactress =~ /$searchkey/i){
push @matches, $_
};
}
elsif ($searchwhat eq "mdes"){
($mtype, $mname, $mactor, $mactress, $mdes) = split (/\|/);
if ($mdes =~ /$searchkey/i){
push @matches, $_
};
}
close(DB);
#end of search section
#start of response page
$nummatches = @matches;
$searchkey = $query->param("searchkey");
print<<HTML_RESPOSE
Content-type: text/html
<HTML>
<BODY>
<h2>Your search for $searchkey return $nummatches matches.</h2>
foreach $matchedEntry (@matches){
print "$matchedEntry\n";
}
</BODY>
</HTML>
HTML_RESPONSE
i get the message Cand find String Terminator "HTML_RESPONSE" anywhere
before line .... everytime i try to compile the script
can anyone tell me what is wrong with it ?
#!/usr/bin/perl
use CGI;
my($query);
$query = new CGI;
##Configuration section
$dbpath = 'db.txt';
$searchwhat = $query->param("searchwhat");
$searchkey = $query->param ("searchkey");
##end of configuration
#Begin search section
open (DB, "<$dbpath") or die ("$!\n");
while (<DB>){
if ($searchwhat eq "all"){
if (/$searchkey/i){
push @matches, $_
};
}
elsif ($searchwhat eq "mtype"){
($mtype, $mname, $mactor, $mactress, $mdes) = split (/\|/);
if ($mtype =~ /$searchkey/i){
push @matches, $_
};
}
elsif ($searchwhat eq "mname"){
($mtype, $mname, $mactor, $mactress, $mdes) = split (/\|/);
if ($mname =~ /$searchkey/i){
push @matches, $_
};
}
elsif ($searchwhat eq "mactor"){
($mtype, $mname, $mactor, $mactress, $mdes) = split (/\|/);
if ($mactor =~ /$searchkey/i){
push @matches, $_
};
}
elsif ($searchwhat eq "mactress"){
($mtype, $mname, $mactor, $mactress, $mdes) = split (/\|/);
if ($mactress =~ /$searchkey/i){
push @matches, $_
};
}
elsif ($searchwhat eq "mdes"){
($mtype, $mname, $mactor, $mactress, $mdes) = split (/\|/);
if ($mdes =~ /$searchkey/i){
push @matches, $_
};
}
close(DB);
#end of search section
#start of response page
$nummatches = @matches;
$searchkey = $query->param("searchkey");
print<<HTML_RESPOSE
Content-type: text/html
<HTML>
<BODY>
<h2>Your search for $searchkey return $nummatches matches.</h2>
foreach $matchedEntry (@matches){
print "$matchedEntry\n";
}
</BODY>
</HTML>
HTML_RESPONSE