Perl problems with system command
Hey everyone,
I am working on a simple perl script for school and am having an issue with outputting a ping command to a browser. Here is what is in my script and it use to work on Redhat 9 with Apache 2. I have Fedora 5 installed with the same config and it doesn't display the ping command. Any help would be appreciate.
Code :
#!/usr/bin/perl
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<HEAD>\n";
print "<TITLE>Ping results</TITLE>\n";
print "</HEAD>\n";
print "<BODY BGCOLOR=#FFFFFF LINK=#4133EF ALINK=FF0000 VLINK=#FF0000>\n";
print "<CENTER>\n";
print "<H1>Ping Results</H1>\n";
print "<BR>\n";
print "<P>\n";
print "<FONT SIZE+2>\n";
print "<P>\n";
print "<A HREF=$ENV{'HTTP_REFERER'}>\n";
print "Click here</A> To return to the previous page\n";
print "<BR>\n";
print "</FONT>\n";
print "<P>\n";
print "</CENTER>\n";
print "<PRE>\n";
system "ping -c $FORM{'pinter'} $FORM{'pnghost'}";
print "</PRE>\n";
print "<P>";
print "</BODY>\n";
print "</HTML>\n";
Thanks,
AgentRn007
|