my %hash = ( 20 => 'zwanzig', 30 => 'dreissig', 40 => 'vierzig', ....); my $x = 20; if (exists $hash{$x}) {  $x = $hash{$x}; } # if else {  print "Kein Wert gefunden\n"; } # else