use strict; use warnings; our %cs101 = ("joe"=> "80" ); print "Choose which hash\n"; chomp (my $input = ); #my $whichhash=\%cs101; my $whichhash="$input"; sub hashvalues { no strict 'refs'; while( my ($key, $value) = each (%{$whichhash}) ) { print "$key $value\n"; } } &hashvalues;