Okay. I've spent a while looking at this and now I'm going cross-eyed. I've got it working on my webserver after a bit of manipulation.
I've modified the table.html file to the following:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3
+.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Test</title>
</head>
<body>
<p>Test</p>
<form method="get" action="/cgi-bin/test.pl">
<input type="hidden" name="update" value="Update"/>
<input type="submit" name="cancel" value="Cancel"/>
<input type="submit" name="insert" value="Insert"/>
<input type="submit" name="confir" value="Confirm"/>
</form>
<!-- MESS// -->
</body>
</html>
... and changed the line:
if($insert eq "insert"){
to:
if($insert eq "Insert"){
The other change I made was to put the full path name into the $out_file line, like so:
$out_file = "/opt/csw/apache/htdocs/table.html";
open(OUTPUT, "$out_file") || print "L40 - There is no file here, I'll
+run away now!";
My guess is that when you create the filename $out_file something is going wrong (perhaps you are pointing at the wrong directory, maybe the perl script and the html page are not in the same place), you then try to open the file which doesn't exist and so get the "L40" error message.
You've been given a number of good options for correctly finding the path of the file and a number of recommendations for modules to make your life easier (the template modules for example) - it might be time to look at those more closely. |