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.
In reply to Re^2: print() on Closed File Handle Error!
by dasgar
in thread print() on Closed File Handle Error!
by twaddlac
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |