in reply to do until sysopen()

You can also use File::Temp, which can give you back an open filehandle and a filename. (thus avoiding various race conditions)
use File::Temp qw(tempfile); my ($fh, $filename) = tempfile( DIR => $tmpdir );

-Blake