Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: finding duplicate data

by gjb (Vicar)
on Jan 21, 2004 at 10:49 UTC ( #322835=note: print w/replies, xml ) Need Help??


in reply to finding duplicate data

Sounds very much like homework, so I'll just give you a tip: a hash (e.g. %data) would come in handy. You can use the data (A(01), B(02), etc) as keys and the number of times you encounter the data as values.

$data{$line}++;
would do the trick.

As a final step, you iterate over the keys (the function keys is useful here) in the hash and print those keys that have values larger than 1.

Hope this helps, -gjb-

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://322835]
help
Chatterbox?
[james28909]: now if i have packed a script into a PDK exe, and misplaced the source, i can print it.
[james28909]: but you have to prepare for it first by adding this to the source
[james28909]: seek DATA, 0, 0; while (<DATA>) { print; }
[Lady_Aleena]: Sounds interesting. Have you written a meditation or cool use for it?
[Lady_Aleena]: It might be something PerlMonks at large would be interested in.

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2017-05-01 00:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (543 votes). Check out past polls.