Leser: 22
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
my %asdu; open(my $FH_ASDU, "<$asdu_datei") or die "open file: $!"; while(my $line = <$FH_ASDU>) { chomp $line; if ($line =~ m/(\d*.\d\d)\s(.*)/) { my $mandant_lokal = $2; my $summe_lokal = $1; $mandant_lokal =~ s/\s*$//; print "$mandant_lokal: $summe_lokal\n"; %asdu = ("$mandant_lokal" => "$summe_lokal"); } } my @schluessel = keys(%asdu); foreach (@schluessel) { print "$_\n"; }
%asdu = ( $mandant => $summe );
$asdu{$mandant} = $summe;