$filehandle2 = new IO::File; $filehandle2->open (">texthash.text") or die $!; print $filehandle2 $newstr; $filehandle2->close ();