Read file content to a scalar variable
open (FILEHANDLE, "<file.txt") or die "Cannot open file.txt"; $text = ""; until (eof FILEHANDLE) { read (FILEHANDLE, $newtext, 1) $text .= $newtext; } print $text;