emilford has asked for the wisdom of the Perl Monks concerning the following question:
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?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); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI troubles - not writing to file
by Aristotle (Chancellor) on Jun 30, 2002 at 16:35 UTC | |
|
Re: CGI troubles - not writing to file
by cjf (Parson) on Jun 30, 2002 at 15:15 UTC | |
by emilford (Friar) on Jun 30, 2002 at 15:19 UTC | |
|
Re: CGI troubles - not writing to file
by emilford (Friar) on Jun 30, 2002 at 15:41 UTC | |
by amphiplex (Monk) on Jun 30, 2002 at 20:50 UTC | |
by amphiplex (Monk) on Jul 01, 2002 at 08:57 UTC |