Dear all,
I am sorry bugging you guys again. 
I got a perl file and data file. When I tried to run it through IE, it does 
not display the contents of the data file instead of it open the perl script 
file itself in notepad. 
Please help me how I can read my data file by my perl script and display it 
into a browser.

------
Perl Script

#!/usr/bin/perl

$data_file="data.txt";

#reading a file 
open(DAT, $data_file) || die("Could not open file!");
@raw_data=<DAT>;
close(DAT);

print "Content-type: text/html\n\n";
print "<HTML><BODY>";

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.";
 print "<BR>\n";
}

print "</BODY></HTML>";

------
Data file 

The Rock|Cheer|Rock Bottom
Triple H|Boo|Pedigree
Stone Cold|Cheer|Stone Cold Stunner
 








_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to