I think this would explain your results. Printing $random_name{$bob} is actually $random_name{''} and you are probably entering the string 'bob' at the prompt.
Try this to verify what you have in %random_name:
use Data::Dumper; print Dumper( \%random_name );
In reply to Re: calling a hash
by cbrandtbuffalo
in thread calling a hash
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |