[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Finding duplicated code



In article <4.2.2.20000106164001.00a344f0@mail.psdt.com>,
Peter Scott <Peter@PSDT.com> wrote:
>One minuscule problem: the matches printed are on the normalized string, 
>which is not as useful as the input string.  So I would like to map 
>backwards from a match in the normalized string to the input string.  None 
>of the ways I can think of doing this make it nearly worth the effort, 
>though :-)

Seems like if you can see your way to leaving in the newlines, they
can act as checkpoints to align the two.  After matching, you would
count newlines before the point matched and in the match (with tr///),
then split and splice to get the corresponding lines in the original.

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe