Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Detecting duplicate entries

by kilinrax (Deacon)
on Mar 01, 2001 at 21:56 UTC ( #61590=note: print w/replies, xml ) Need Help??

in reply to Detecting duplicate entries

Slurp it into a hash? ;-)
#!/usr/bin/perl -w use strict; my %unique; while (<DATA>) { chomp; $unique{$_} = ''; } my @array = keys %unique; $, ="\n"; print @array; __DATA__ Brentwood Brentwood Westwood Beverly Hills Beverly Hills Beverly Hills Bev Hills Adj. Palms Mar Vista Mar Vista Mar Vista Mar Vista Mar Vista Venice Santa Monica Santa Monica LA/Crescent LA/Crescent Koreatown 3rd/LaBrea 3rd/LaBrea 3rd/LaBrea
(of course, if you want to preserve order too, some extra cunningness will be required; but the basic idea remains the same)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2022-05-24 18:41 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (84 votes). Check out past polls.