- or download this
my %seen;
my @union = grep {! $seen{$_}++} @rows, @data;
- or download this
my %seen;
@seen{@data, @rows} = ();
@data = keys %seen;
- or download this
@data = uniq @data, @rows;
- or download this
use strict;
use warnings;
...
listutil => sub {my $f = listutil(\@first, \@second)},
seengrep => sub {my $f = seengrep(\@first, \@second)},
});
- or download this
ok 1 - They matched.
ok 2 - They matched again.
...
seengrep 3555/s -- -16% -17%
slice 4233/s 19% -- -1%
listutil 4297/s 21% 2% --
- or download this
my @list_A = (1..1000);
my @list_B = (1..1000);
...
do_something($element_A, $element_B);
}
}
- or download this
foreach my $row (@rows) {
push @data, $row unless $row ~~ @data;
}
- or download this
foreach my $row (@rows) {
my $found = 0;
...
}
push @data, $row if $found;
}
- or download this
foreach my $element(@data, @rows) {
$seen{$_} = ();
}