in reply to creating a text file at run time and writing to it.

To add to phenom's recommendations, I'd also suggest letting Perl allocate the filehandle rather than hardcoding it, e.g. open my $fh, ...

-M

Free your mind