Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: Remove redundency from an array

by lyklev (Pilgrim)
on Sep 25, 2007 at 21:28 UTC ( #641046=note: print w/replies, xml ) Need Help??


in reply to Re^2: Remove redundency from an array
in thread Remove redundency from an array

You are right, it should have been just

@array = (shift @sorted)

(the parentheses are to make it an array assignment).

If there are many duplicates it might be more efficient to first remove the duplicates before sorting. But there is no transforming the array into a hash and back.

I can't tell which is more efficient. My intention was to show a different approach. It shows again that there are many ways to do similar things.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://641046]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2018-07-20 07:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (426 votes). Check out past polls.

    Notices?