#!/usr/bin/perl my $handle1; open($handle1, "< /tmp/1") || die "Input file does not exist.\n"; # Case 2 -- fails GetFileContentsViaFnHash(\*$handle1); close($handle1); sub GetFileContentsViaFnHash { my %test; $test{FH} = shift; print "Function hash:\n"; { local($/); print <$test{FH}>; } }