in reply to Substitution problem.
Which presumably (if it were valid) would match the text "quotemeta'['", putting '[' into $1. Try doing this:s/quotemeta('[')/quotemeta('x')/g;
Or, if each array element simply has one character apiece (as you suggest), forego the loop entirely and use tr:s/\Q$array1{$count}\E/$array2{$count}/g;
$from = join('', @array1); # or set up $from and $to $to = join('', @array2); # to begin with tr/$from/$to/; # e.g. "abc" =~ tr/ab/xy/ ==> "xyc"
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Substitution problem.
by Dominus (Parson) on Nov 25, 2000 at 08:47 UTC | |
by snax (Hermit) on Nov 25, 2000 at 19:50 UTC | |
by tilly (Archbishop) on Nov 25, 2000 at 20:08 UTC | |
by snax (Hermit) on Nov 25, 2000 at 20:15 UTC |