use warnings; use strict; use Data::Dumper; my %hoh = ( cs101 => { joe => 80 }, cs102 => { moe => 90 } ); print "Choose which hash\n"; chomp (my $input = <STDIN>); if (exists $hoh{$input}) { my %hash = %{ $hoh{$input} }; # dereference hash print Dumper(\%hash); } else { print "$input not found\n"; } __END__ Choose which hash cs101 $VAR1 = { 'joe' => 80 };
In reply to Re: Dereference array via STDIN
by toolic
in thread Dereference array via STDIN
by gctaylor1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |