Thread Code optimieren (Laufzeit/Geschwindigkeit)
(9 answers)
Opened by Hans at 2012-01-26 14:23
Igitt. Bandnudelsdalat!
Beispiel: Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 my @file_and_signals1 = qw/AA BB CC/; my @file_and_signals2 = qw/22 BB 33 44/; my @file_and_signals3 = qw/jj BB CC kk oo pp 99/; my @file_and_signals4 = qw/xx kk ll/; my %count_hash; for my $a ( \@file_and_signals1, \@file_and_signals2, \@file_and_signals3, \@file_and_signals4 ) { for my $w(@$a) { $count_hash{$w}++; } } while (my ($k,$v) = each %count_hash) { print "$k $v\n" if $v>1; } |