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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.