-w is a file test operator. It tests to see if the running script can write to the specified file. I suggested this because I suspect your export might have failed because it can't write to your output file, and is giving you a misleading error message.
If you've run this and the print statement ran then you could have a problem with file permissions, or just have a bad path. Although thinking about it, -w can only return true if your file already exists, so may not be useful to you.
try temporarily adding
open TEST, ">>$savename" or
print LOG "Couldn't open file for appending: $!\n";
close TEST;
That's a better test to see if you've got permission problems, and any error will be logged.
---
my name's not Keith, and I'm not reasonable.
|