#!/usr/bin/perl -w use strict; my $name = chomp(); my %city_codes = qw(München => 66021, Gurke => 66024, XXX => 66087 ); if (exists $city_codes{$name}) { print "Zugewiesene Nummer fuer $name: $city_codes{$name}\n"; } else { print "Wert in \$name '$name' unbekannt.\n"; }