use IO::File; $filehandle = new IO::File; $filehandle->open("<file.txt") or die "Could not open file.txt"; $text = ""; until ($filehandle->eof) { $filehandle->read($newtext, 1); $text .= $newtext; } print $text; $filehandle->close;