in reply to filehandle

use FileHandle; $fh = new FileHandle; if ($fh->open ("> foo")) { print $fh "bar\n"; $fh->close; } # Try this - there were just a couple of missing brackets