Thread 2 Arrays vergleichen (3 answers)
Opened by Gast at 2003-10-15 13:34

format_c
 2003-10-15 14:10
#63758 #63758
User since
2003-08-04
1706 Artikel
HausmeisterIn
[Homepage] [default_avatar]
Hi
Mein Vorschlag so offhand:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
use strict;
my @original = qw/1 3 2 4/;
my @kopie = qw/3 2 1 4 2 3 2 1 4/;
for my $v (0..$#original) {
 print "$v ($original[$v]) Element: ",
 join(" & ",grep($original[$v]==$kopie[$_],(0..$#kopie))),"\n";
}
_ _ END _ _
0 (1) Element: 2 & 7
1 (3) Element: 0 & 5
2 (2) Element: 1 & 4 & 6
3 (4) Element: 3 & 8



Gruß alex\n\n

<!--EDIT|format_c|1066212644-->

View full thread 2 Arrays vergleichen