Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: removing duplicates entries from an array

by kulls (Hermit)
on Jan 06, 2006 at 17:18 UTC ( [id://521551]=note: print w/replies, xml ) Need Help??


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;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://521551]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (8)
As of 2024-04-24 09:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found