Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: 'sort -u' in perl

by JediWizard (Deacon)
on Jul 06, 2006 at 18:41 UTC ( [id://559640]=note: print w/replies, xml ) Need Help??


in reply to 'sort -u' in perl

perl -e "my %hash; @hash{<>} = 1; print sort keys %hash;"

They say that time changes things, but you actually have to change them yourself.

—Andy Warhol

Replies are listed 'Best First'.
Re^2: 'sort -u' in perl
by cowboy (Friar) on Jul 06, 2006 at 19:39 UTC
    The op mentioned this was a huge file. Reading the entire thing into a hash, then performing 2 copies on the data (sort keys) is probably going to be very painful depending on how huge is huge.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-23 07:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found