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