hi...
i am beginner in perl cgi programming..i am atempting to read from a file....
my cgi script is
[code=perl]
#!c:\perl\bin\p erl -wT
#print "content-type: text/html \n\n";
use CGI qw(:standard);
use strict;
print header;
print start_html ("ebanking") ;
my $ne=param('name ');
my $pwid=param('pw d');
open(FP,"input. txt") or die "cannot open file";
@raw_data=<DAT> ;
close(DAT);
foreach $account (@raw_data) {
chop($account);
($w_name, $pswd, $accno, $address, $type, $balance) = split(/\|/,$account);
if (( $ne eq $w_name) and ( $pwid eq $pswd)) {
print " \nName: $w_name Balance: $balance" ;
} else {
print "\n User name and password not match";
}
}#fore each
print end_html;
[/code]
when the above code is executed using WIN 32 apache it shows an internal error...this is the syntax given in every website....
if i remove the print statements corresponding to cgi and run in command line perl it works perfectly....
please help...
i am beginner in perl cgi programming..i am atempting to read from a file....
my cgi script is
[code=perl]
#!c:\perl\bin\p erl -wT
#print "content-type: text/html \n\n";
use CGI qw(:standard);
use strict;
print header;
print start_html ("ebanking") ;
my $ne=param('name ');
my $pwid=param('pw d');
open(FP,"input. txt") or die "cannot open file";
@raw_data=<DAT> ;
close(DAT);
foreach $account (@raw_data) {
chop($account);
($w_name, $pswd, $accno, $address, $type, $balance) = split(/\|/,$account);
if (( $ne eq $w_name) and ( $pwid eq $pswd)) {
print " \nName: $w_name Balance: $balance" ;
} else {
print "\n User name and password not match";
}
}#fore each
print end_html;
[/code]
when the above code is executed using WIN 32 apache it shows an internal error...this is the syntax given in every website....
if i remove the print statements corresponding to cgi and run in command line perl it works perfectly....
please help...
Comment