Using getc function to read character from a file
open (FILEHANDLE, "<file.txt") or die ("Cannot open file.txt"); while (defined($char = getc FILEHANDLE)){ print $char; } close FILEHANDLE;