Using read function in while loop : file read « File « Perl
- Perl
- File
- file read
Using read function in while loop
use IO::File;
$filehandle = new IO::File;
$filehandle->open("<file.txt") or die "Could not open file.txt";
$text = "";
while ($filehandle->read($newtext, 1)) {
$text .= $newtext;
}
print $text;
$filehandle->close;
Related examples in the same category