programming-examples/perl/File/Pass file handle reference in a the form of FILEHANDLEIO.pl

14 lines
184 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
sub printem
{
my $file = shift;
while (<$file>) {
print;
}
}
open FILEHANDLE, "<file.txt" or die "Can not open file";
printem *FILEHANDLE{IO};