in reply to Creating file at run time

I'd use something like this.
HTH
#!/usr/bin/perl -w use FileHandle; my $fh = FileHandle->new('test','+>'); print $fh $_ while (<DATA>); $fh->close; __DATA__ Test this