my %hash = (one => 'uno', two => 'dos', three => 'tres'); my $input = ; chomp $input; if (my $ans = $hash{$input}) { print "$input => $ans\n"; }