Hi all,
Here is my script:
$data_file="wrestledata.cgi";
open(DAT, $data_file) || die("Could not open file!"
;
@raw_data=<DAT>;
close(DAT);
print "Content-type: text/html\n\n";
print "<HTML><BODY>";
print "<HEAD>";
print "<TITLE>Perl Variable Test</TITLE>";
print "</HEAD>";
foreach $wrestler (@raw_data)
{
chop($wrestler);
($w_name,$crowd_re,$fav_move)=split(/\|/,$wrestler);
print "When $w_name is in the ring, the crowd might $crowd_re when the $fav_move is used.\n";
print "<BR>\n";
}
print "</BODY></HTML>";
----------------
When I run this using command prompt, I get the following:
Content-type: text/html
<HTML><BODY><HEAD><TITLE>Perl Variable Test</TITLE></HEAD>When The Rock is in th
e ring, the crowd might Cheer when the Rock Bottom is used.
<BR>
When Triple H is in the ring, the crowd might Boo when the Pedigree is used.
<BR>
When Stone Cold is in the ring, the crowd might Cheer when the Stone Cold Stunne
r is used.
<BR>
</BODY></HTML>
------------------
Unfortunately, when I run this from within Windows IE (Win2K using IIS), I get CGI Error:
"Could not open file! at c:\inetpub\ line 2."
-----------------------
Pls advise urgently.
Regards,
Vivek
Here is my script:
$data_file="wrestledata.cgi";
open(DAT, $data_file) || die("Could not open file!"
@raw_data=<DAT>;
close(DAT);
print "Content-type: text/html\n\n";
print "<HTML><BODY>";
print "<HEAD>";
print "<TITLE>Perl Variable Test</TITLE>";
print "</HEAD>";
foreach $wrestler (@raw_data)
{
chop($wrestler);
($w_name,$crowd_re,$fav_move)=split(/\|/,$wrestler);
print "When $w_name is in the ring, the crowd might $crowd_re when the $fav_move is used.\n";
print "<BR>\n";
}
print "</BODY></HTML>";
----------------
When I run this using command prompt, I get the following:
Content-type: text/html
<HTML><BODY><HEAD><TITLE>Perl Variable Test</TITLE></HEAD>When The Rock is in th
e ring, the crowd might Cheer when the Rock Bottom is used.
<BR>
When Triple H is in the ring, the crowd might Boo when the Pedigree is used.
<BR>
When Stone Cold is in the ring, the crowd might Cheer when the Stone Cold Stunne
r is used.
<BR>
</BODY></HTML>
------------------
Unfortunately, when I run this from within Windows IE (Win2K using IIS), I get CGI Error:
"Could not open file! at c:\inetpub\ line 2."
-----------------------
Pls advise urgently.
Regards,
Vivek