in reply to Re: print() on Closed File Handle Error!
in thread print() on Closed File Handle Error!
I was assuming that the filehandle would automatically create the file to write to, and it didn't hence the error message.
If that's what you're trying to do, you'll need to use the '>>' mode for open, which will create the file if it doesn't exist and destroy the contents if it does exist. Still, even when I have used this mode in my scripts, I still include the die statement and would recommend that you do so too. Very useful in debugging issues as you have just learned.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: print() on Closed File Handle Error!
by kennethk (Abbot) on Aug 13, 2010 at 19:12 UTC | |
by dasgar (Priest) on Aug 13, 2010 at 19:25 UTC | |
|
Re^3: print() on Closed File Handle Error!
by Marshall (Canon) on Aug 15, 2010 at 01:19 UTC |