Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any Suggestions??? Appearently a bad script!
Message
From
22/07/2002 11:20:29
 
 
To
All
General information
Forum:
Perl
Category:
CGI/HTTP - Internet Apps
Title:
Any Suggestions??? Appearently a bad script!
Miscellaneous
Thread ID:
00681164
Message ID:
00681164
Views:
49
Hello all again ;
I am trying to write a cgi script that will be running under perl 5, but I am having a hard time getting the syntax right appearently. What this script is supposed to do is open a text file which contains ranges of control numbers, and the redirected http addresses. This script is supposed to take the control number which is coming from another form(http)and search the text file to get the correct redirect http address. When I run it, I dont get errors.. but just gives me the 404 error(page not found). Please look at my .Cgi script below:

#!/usr/bin/perl

$datafile = "httpdata.txt";
$control = $FORM{'CONTROL'} ;
print "Set-Cookie: CONTROL=$FORM{'CONTROL'}\n";
$searchstr = $control;
open(INF,$datafile);
@mydata = ;
close(INF);
print "This is working\n\n" ;
print "Content-type:text/html\n\n";
@results = grep(/$searchstr/i,@mydata);
if ($#results > 0) {
foreach $i (@results)
{
chomp($i);
($reference,$start,$end,$addr) = split(/; /,$i);
if ($start<= $control and $end>= $control)
{
print "location: $addr\n";
}
}
}
else
{
print "No results found\n" ;
}
print "location: $addr\n\n";


Any Ideas?
PLEASE HELP!!!!

Thanks
Rick
Next
Reply
Map
View

Click here to load this message in the networking platform