in reply to Removal of duplicated element in array.
Hi tty1x,
A few snapshot observations and 2 'kobo' suggestion:
use warnings; use strict; my $match = <<'EOF'; dddd@fgg.com cccc@fgg.com eeee@fgg.com dddd@fgg.com EOF my %seen; my @r; foreach my $v ( split /\n/, $match ) { unless ( $seen{$v}++ ) { push @r, $v; } } $" = "\n"; print "@r";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Removal of duplicated element in array.
by choroba (Cardinal) on May 07, 2013 at 15:12 UTC | |
by 2teez (Vicar) on May 07, 2013 at 16:29 UTC |