Using getc function with while loop : getc « File « Perl
- Perl
- File
- getc
Using getc function with while loop
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;
Related examples in the same category