use strict; use warnings; sub file_read { local $.; my $fh = shift; while (<$fh>) { print } return $.; } print file_read(\*STDIN), "\n";