Pass file handle reference in a the form of '*FILEHANDLE{IO}'
sub printem { my $file = shift; while (<$file>) { print; } } open FILEHANDLE, "<file.txt" or die "Can not open file"; printem *FILEHANDLE{IO};