Using read function to read a file : file read « File « Perl
- Perl
- File
- file read
Using read function to read a file
open (FILEHANDLE, "<file.txt") or die "Cannot open file.txt";
$text = "";
while (read (FILEHANDLE, $newtext, 1)){
$text .= $newtext;
}
print $text;
Related examples in the same category