in reply to Re: removing duplicates entries from an array
in thread removing duplicates entries from an array

We can directly replace   push @unique, $dll; with  $unique{$dll}=1 .
why not ?
- kulls

Replies are listed 'Best First'.
Re^3: removing duplicates entries from an array
by ikegami (Patriarch) on Jan 06, 2006 at 17:27 UTC
    Yes, RDup could be eliminated. I didn't remove it for the sake of reusability.
    my %unique; foreach $d (@dllExeLines) { if ($d =~ /\Q$serviceName/) { foreach $f (split(/,/, $d)) { if ($f =~ /\Q$dll/i) { $unique{lc($dll)} = $dll; } } } } my @unique = sort values %unique;