in reply to Writing to file

I am having trouble creating a log file for this script
What kind of troubles? Do you get bluescreens? Does your computer explode?
I believe this is the line that is causing the trouble, if I had to guess.
Do not guess, do not believe. Test your hypothesis.

Replies are listed 'Best First'.
Re^2: Writing to file
by SteveS832001 (Sexton) on Mar 18, 2011 at 17:28 UTC
    Well, I get no errors, the program runs just fine. It created the output file, but there is nothing inside the file when the program stops. If I take out the line then the program won't run,so I am not sure how you want me to Test my Hypothesis.

      Debugging is not a magical process that only monks can achieve... You just need to learn the common tricks, and apply some imagination.

      For example, you're writing to a file, and its not working. Print out all the return values and input values as you go. And trim it down to a script that only writes a canned string to that file in order to eliminate possibilities.

      Keep chopping off code until the problem either goes away or becomes trivial.