Jeff 'Japhy' Pinyan wrote:
>
> On Jul 27, Paul Tremblay said:
>
> >The only problem is how I should replace "&", ">", and "<". I think I'll
> >do single line subs for this text. Even with huge files it shouldn't
> >take more than 1/2 a second or so, and that allows me to use your
> >original method to speed things up.
> >
> >Or this just occurred to me:
> >
> >s[(&)|(<)|(>)|\\($rx)][<$rep{$1}/>]go;
> >
> >Yea, that should work!
>
> No, $1 is either "&" or undef. Perhaps you want:
>
> s[([&<>])|\\($rx)][<$rep{$+}/>]go;
>
> That $+ means "the last () that matched". But that still replaces & with
> <&/>. So you'd need to make the '<' and '/>' part of the %rep hash's
> values. I would suggest:
I thought '<' and '/>' were already in the hash values? If so, wouldn't
this work?
s[([&<>]|(?<=\\)$rx)][$rep{$1}]go;
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]