versuch es mal; habs nicht getestet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use strict;
use warnings;
my %lookup = ();
open(F1, "< datei1.txt") or die $!;
while(<F1>) {
$_ =~ s![\r\n]+$!!;
my ($key, $val) = split /-/, $_;
$lookup{$key} = $val;
}
close F1;
my $r = join "|", map keys %lookup;
open(F2, "< datei2.txt") or die $!;
open(F3, "> datei3.txt") or die $!;
while(<F2>) {
s!($r)!$lookup{$1}!ge;
print F3 $_;
}
close F3;
close F3;