Hi,
Could someone help me out with this ? I am a novice as far as perl programming is concerned.
The following HTML if invoking the cgi script mentioned below. However, the result is:
'D:\Rajan\cgi-bin\comments.cgi' script produced no output
What is wrong with the script ?
Thanks,
Rajan
HTML
<FORM action=" method="get">
Problem Type:
<INPUT type=radio name=probtype value=hardware>hardware
<INPUT type=radio name=probtype value=software>software
<BR>
<TEXTAREA name=problem rows=10 cols=40>
Describe your problem.
</TEXTAREA>
<BR>
Your Name:
<INPUT type=text width=40 name=name><BR>
<INPUT type=submit name=submit value="Submit Problem">
</FORM>
CGI Script
#! d:\perl\bin\perl -w
use strict;
use CGI qw
standard);
my $comment_book = "d:\rajan\comment_book.txt";
sub save {
open ( CB, ">>$comment_book" ) die "Cannot open $comment_book";
print CB "Name: ", param('name'), "\n";
print CB "Problem Type: ", param('probtype'), "\n";
print CB "Problem Description: ", param('problem'), "\n";
close (CB);
}
sub display {
open ( CB, "$comment_book" ) die "Cannot open $comment_book";
while (<CB>) {
print "<B>$_</B><P>";
my ($type, $prob);
$type = <CB>;
$prob = <CB>;
print "$type<P>";
print "$prob<BR><HR>";
}
close (CB);
}
print header;
if (defined param('submit'))
save;
display;
}
Could someone help me out with this ? I am a novice as far as perl programming is concerned.
The following HTML if invoking the cgi script mentioned below. However, the result is:
'D:\Rajan\cgi-bin\comments.cgi' script produced no output
What is wrong with the script ?
Thanks,
Rajan
HTML
<FORM action=" method="get">
Problem Type:
<INPUT type=radio name=probtype value=hardware>hardware
<INPUT type=radio name=probtype value=software>software
<BR>
<TEXTAREA name=problem rows=10 cols=40>
Describe your problem.
</TEXTAREA>
<BR>
Your Name:
<INPUT type=text width=40 name=name><BR>
<INPUT type=submit name=submit value="Submit Problem">
</FORM>
CGI Script
#! d:\perl\bin\perl -w
use strict;
use CGI qw
my $comment_book = "d:\rajan\comment_book.txt";
sub save {
open ( CB, ">>$comment_book" ) die "Cannot open $comment_book";
print CB "Name: ", param('name'), "\n";
print CB "Problem Type: ", param('probtype'), "\n";
print CB "Problem Description: ", param('problem'), "\n";
close (CB);
}
sub display {
open ( CB, "$comment_book" ) die "Cannot open $comment_book";
while (<CB>) {
print "<B>$_</B><P>";
my ($type, $prob);
$type = <CB>;
$prob = <CB>;
print "$type<P>";
print "$prob<BR><HR>";
}
close (CB);
}
print header;
if (defined param('submit'))
save;
display;
}