Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re^3: Comparing lines in txt.file

by aaron_baugher (Curate)
on Aug 16, 2012 at 10:34 UTC ( #987733=note: print w/replies, xml ) Need Help??

in reply to Re^2: Comparing lines in txt.file
in thread Comparing lines in txt.file

I don't want to be rude, but you said this is for an assignment. If you don't know Perl well enough to even try something that we can help you with, then you probably need to go back to the beginning and start over. If we just give you the solution, that may satisfy your teacher/boss this time, but you'll be even further behind for the next assignment.

This is a pretty straightforward task: read the lines, parsing out the IP addresses and saving them to a hash, checking to see if they already exist as a hash key and alerting if one does. The parsing could be done with split or a regex (I'd vote for split here). All pretty basic Perl stuff.

Aaron B.
Available for small or large Perl jobs; see my home node.

Replies are listed 'Best First'.
Re^4: Comparing lines in txt.file
by zakishah (Novice) on Aug 17, 2012 at 03:20 UTC
    Thank you very much you are very right i tried many perl tutorials but time is important factor which pushed me to seek help here i would be very glad if you give me solution along with explaination that can boost my knowledge too. Thanks

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://987733]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2018-01-24 10:18 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (257 votes). Check out past polls.