Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Detecting duplicate entries

by kilinrax (Deacon)
on Mar 01, 2001 at 21:56 UTC ( [id://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?
Username:
Password:

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

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

    No recent polls found