Leser: 23
1 2 3 4 5 6 7 8 9 10 11
$outputname=$name; foreach ($name) { if ($name=München) {$outputname=66021;} if ($name=Gurke) {$outputname=66024;} if ($name=XXX) {$outputname=66023;} if ($name=XXX) {$outpuname=62086;} if ($name=XXX) {$outputname=62087;} } $OUTPUT2=$_dir2."/NO".".$outputname."_".$now_date.".txt";
if ($name eq 'München') {$outputname=66021;}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl -w
use strict;
my $name = chomp(<STDIN>);
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";
}
QuoteLinux hat meist UTF-8, Windows in der Konsole CP850, während Windows selbst Windows-1252.