Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: CGI troubles - not writing to file

by cjf (Parson)
on Jun 30, 2002 at 15:15 UTC ( #178371=note: print w/ replies, xml ) Need Help??


in reply to CGI troubles - not writing to file

Your script works fine for me when called like so:

my $index = 'data.txt'; my $backup = 'data2.txt'; back_up_file($index, $backup);

It copies the data into data2.txt as expected.

Update: Have you checked the backup file and Index files? Are they both actually empty? Do you open the files anywhere else in the script? If you post the rest of the code we can check it out.


Comment on Re: CGI troubles - not writing to file
Download Code
Re: Re: CGI troubles - not writing to file
by emilford (Friar) on Jun 30, 2002 at 15:19 UTC
    Yes, it seems that it should be working correctly, but for some reason it's not. My backup_index.html file turns up entirely blank. I hate when things just don't work when they seemingly should. Could another part of the script have an effect on this one function? I know it is at least getting to the back_up_file function since the file is being opened in write mode (hence being emptied out).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://178371]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2014-12-25 07:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (159 votes), past polls