How may I avoid partial interpolation over a pattern sustitution?

My code looks like:

    # searching for all matches for later use
    @matches = $htmlpage =~ m/<pre>(.*?)<\/pre>/gs;
    for ($i=0; $i<$#matches; $i++)
      { $htmlpage =~ s/<pre>$matches[$i]<\/pre>/<predefined:$i\/>/; }


The problem comes when the matches contains regex characters, and they try to be evaluated (ex. '|+--..' must be interpeted like '\|\+--\.\.').



Is the only solution implement a pre-transform regex characters? Any better (and fine) solution?


TIA,

--


Saludos,


J. Alejandro Ceballos Z. | ------------------------------+--------------------------- http://alejandro.ceballos.info | [EMAIL PROTECTED] | "Estoy convencido -------------------------------+ de que en un principio tel: +52 (33) 3647-7809 | Dios hizo un mundo distinto cel: 044 (33) 1076-4705 | para cada hombre, ------------------------+ y que es en ese mundo, | que está dentro | de nosotros mismos, | donde deberíamos | intentar vivir." | | -- Oscar Wilde |


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to