in reply to Cann't create a file

Did you
use strict; use warnings;
That would tell you if you missed a declaration. I myself would try wrapping the whole thing in an eval and test the result, see if something else is coughing it up.

Don
WHITEPAGES.COM | INC
Everything I've learned in life can be summed up in a small perl script!