Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^4: How do you find duplicates in a string?

by mk. (Friar)
on Sep 21, 2006 at 17:27 UTC ( #574200=note: print w/replies, xml ) Need Help??


in reply to Re^3: How do you find duplicates in a string?
in thread How do you find duplicates in a string?

you'll need a hash to check for the dupes.
$hash{$_}++ foreach(split /\t/,$string); foreach (keys (%hash)) {print $_."\n" if ($hash{$_} > 1 && /^\D+$/)}


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"one who asks a question is a fool for five minutes; one who does not ask a question remains a fool forever."

mk at perl dot org dot br

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2022-01-16 10:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (49 votes). Check out past polls.

    Notices?