in reply to pulling value based on input

I guess I should've posted more of the code because I
must not have been clear on my question but I'll
try again. What I need to do is something like:

if (users input)$loc = a specific key in %locs then return the associated
value of that key from %locs.
## Carries out the users input into an action print "\n"; print "Where do you want to copy from? or type help for help\n"; my $server = <STDIN>; chomp $server; print "What do you want to copy? or type help for help\n"; my $loc = <STDIN>; chomp $loc; if ((exists $servers{$server}) and (exists $locs{$loc})) { print "\n"; print "Ok, Copying $loc Logs from Source: $servers{$server} to tem +porary location:\n"; print "$temp\n\n"; sleep "3"; print "Ok, all done.\n\n"; print "Zipping and moving to FTP Server:\n"; print "$ftp$folfix-$date\n"; } elsif ((my $server = 'help') or (my $loc = 'help')) { print "$sitrep\n"; print "---Log abb:\n"; foreach $locs (sort keys %locs) { print "$locs\n"; } } else { print "Error: unrecognized server\n"; }