Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: searching string from one file in another

by Eily (Monsignor)
on Feb 28, 2017 at 13:35 UTC ( [id://1183141]=note: print w/replies, xml ) Need Help??


in reply to Re: searching string from one file in another
in thread searching string from one file in another

++ on the bad variable names. The fact that the variables have numbers is a first sign that the names are probably not well chosen, but having two variables with the same names (a hash and a scalar named file2) should absolutely be avoided.

Your proposition works fine if the lines in $data are unique, (the fact that they are counted using $file2{$line}++ makes me think they may not be) but will print duplicates otherwise.

  • Comment on Re^2: searching string from one file in another

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-04-23 12:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found