use IO::File; $filehandle = new IO::File; $filehandle->open("<file.txt") or die "Could not open file.txt"; while (defined($char = $filehandle->getc)) { print $char; } $filehandle->close;