George Schlossnagle <[EMAIL PROTECTED]> writes:

> while(<>) {
>       print join("\n", map { "$_ lineno $." } /(string)/g);
> }

George, I haven't gotten good results with either of the pieces of
code you posted.  This one gives me.

  string lineno 1
  string lineno 1string lineno 2 <no newline here>

I can fix the ending newline easy enough but that one in the middle
seems more difficult.


The first one you posted had the same problem:

  while(<>) {
    print join("\n", /(string)/g);
  }

 string
 stringstring<no newline>


It seems lines with multiple matches throw a monkey wrench into it
where as the `push @array,$_ =~ /(string)/g' approach doesn't have
that problem.  

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to