Monks-

I wrote a script a long while back that would allow me to update the front page of my site with a simple HTML form. The script was working perfectly, or at least as good as it needed to be, until just recently. I've tried to recall the changes that I've made to the script since then:
  1. added a hash key/value
  2. changed method="POST to method="POST" in the HTML form
Other than those two changes, I'm almost certain I have changed nothing else. Now, however, when I run the script, my front page turns up completely blank, along with all of the backups I make prior to changing the main page. What could be causing this sudden change in the proper functioning of my script? I know this is a vague questions, but I'm baffled and have no clue what to do, as everything was working perfectly a few hours ago.

A little insight into my script, I do error checking on things like opening files, so it should tell me if the error is occuring there. Nothings shows up, so I'm assuming this isn't the problem. Shouldn't these lines of code work to backup a file?
sub back_up_file { my ($index, $index_backup) = @_; # open the necessary files needed for reading and writing open (INDEX, "<$index") or die &show_error ("Unable to open $index +: $!"); open(BACKUP, ">$index_backup") or die &show_error ("Unable to open + $index_backup: $!"); # write the existing file into the backup while (<INDEX>) { print BACKUP "$_"; } # close the files close (INDEX); close (BACKUP); } # shows the error returned inside of the browser - easier debuging sub show_error { print "Content-type: text/html\n\n"; print "This is the error: <h1>$_[0]</h1>"; exit(0); }
When I check the backup file, however, it is entirely blank. Could this be a permissions issue that my host just changed? I thought about that possibility at first, but when I run a different script that functions similarly, but on a different part of the site, everything runs smoothly as it should. Any suggestions?

In reply to CGI troubles - not writing to file by emilford

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.