Thread Werte in Hash und gleichzeitig doppelte finden
(14 answers)
Opened by rk-ger at 2007-01-01 23:46
[quote=pq,01.01.2007, 23:05]my %seen;
my @unique = grep { ! $seen{$_}++ } @array;[/quote] Schönes Beispiel, aber je nach Größe des Arrays ziemlich unschön, da sich das Ganze verdreifacht. Da würde ich lieber sowas wie Code: (dl
)
1 use strict; bevorzugen, was zudem auch noch um einiges schneller ist: Rate grep shift grep 431/s -- -90% shift 4483/s 941% --\n\n <!--EDIT|opi|1168272145--> What is a good module? That's hard to say.
What is good code? That's also hard to say. One man's Thing of Beauty is another's man's Evil Hack. |