Helio S. Junior ([EMAIL PROTECTED]) wrote:
> Hello,
> 
> How do i read a simple file and look for "repeated
> words" in each line, writing out the words i have
> found and the numbers of line they were found?

Well, that sounds like a homework to me, thus no sample code...

Think about using either a hash or an array for storing the previous
line's words.  When using a hash, you can easily look up if the word in
the current line has been there and report it.  When you use an array,
do a 'perldoc -f grep' to find out how to look for words in there.

Do a 'perldoc perlvar' to find out how to get the current input's
line number.

Mike

-- 
                     If we fail, we will lose the war.

Michael Lamertz          | [EMAIL PROTECTED] / [EMAIL PROTECTED]
    Nordstr. 49          | http://www.lamertz.net
    50733 Cologne        | Work: +49 221 3091-121
    Germany              | Priv: +49 221 445420 / +49 171 6900 310

Reply via email to