I am new to perl and was trying to write a perl program witha UI.
i.e. I have written a html form which invokes a perl program to execute and to print back the data selected in the form.
When i enter details into the html form and click on the submittal button, it throws an error saying
"Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, www@ophidian and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
--------------------------------------------------------------------------------
Apache/2.0.55 HP-UX_Apache-based_Web_Server (Unix) DAV/2 Server at ophidian.india.hp.com Port 8080 "
Below is the code of both the html and the perl script it calls.
Expand|Select|Wrap|Line Numbers
- html:
- <title>FORM 1</title>
- <html>
- <form method="POST"
- action="http://ophidian.india.hp.com:8080/tools/newpro.pl">
- <p>
- <p>
- <table border=5 cellpadding=1 cellspacing=1><center>
- <tr>
- <th colspan=2>Submittal Management Tool</th>
- </tr>
- <tr>
- <td align=left><b>Release:</b></td>
- <td align=center>
- <select name ="release" size=4>
- <option>0706
- <option>0709
- <option>0712
- <option>0803
- <option>0809
- </select>
- </td>
- </tr>
- <tr><td></td><td><center>
- <input type="reset" value="Clear">
- <input type="submit" value="Submit">
- </center></td></tr>
- </table>
- </center>
- </form>
- </html>
Perl:
Expand|Select|Wrap|Line Numbers
- #!/opt/perl/bin/perl
- # The following accepts the data from the form and splits it into its component parts
- 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 "<p>";
- print "<p>";
- print " u selecte rel: $FORM{Release}<p>";
- exit(0);
Could anyone please tell me why i am getting this error?
Please help!