Beefy Boxes and Bandwidth Generously Provided by pair Networks Ovid
go ahead... be a heretic
 
PerlMonks  

Re: Re (tilly) 2: Detect common lines between two files, one liner from shell

by Anonymous Monk
on Mar 16, 2001 at 05:28 UTC ( [id://64893]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re (tilly) 2: Detect common lines between two files, one liner from shell
in thread Detect common lines between two files, one liner from shell

Sorry, I'm new to this and I don't have too much time to read the tutorials, but this I still don't understand $seen{$_} I know $_ is the current stream. .= is like adding it at the end. But what is that hash /10$/ ? But this only matches the exact line length it doesn't look for a the same word. what if I want to find a word in both files and print it out on screen? Thanks.
  • Comment on Re: Re (tilly) 2: Detect common lines between two files, one liner from shell

Replies are listed 'Best First'.
Re (tilly) 4: Detect common lines between two files, one liner from shell
by tilly (Archbishop) on Mar 17, 2001 at 17:41 UTC
    I refuse to repeat the documentation until you have at least tried to read it. That is why it is there and it is faster for both of us if you take advantage of it.

    As for your additional question, the -n option is an implicit loop over the lines in both files. If you want to do words, then within each line you would need to loop over the words as well. But the same logic would work. (OTOH the algorithm will get rather inefficient. But oh well.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://64893]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.