David Garamond wrote:
>
> is there a short recipe to do this in perl? i want to replace all "die"
> with "paint" and preserve case (i.e. "Die" should be replaced by
> "Paint", "DIE" by "PAINT", and so on). there's a smart snippet on TPJ to
> do this:
>
> $string =~ s/($x)/"\L$y"^"\L$1"^$1/ie;
>
is there a short recipe to do this in perl? i want to replace all "die"
with "paint" and preserve case (i.e. "Die" should be replaced by
"Paint", "DIE" by "PAINT", and so on). there's a smart snippet on TPJ to
do this:
$string =~ s/($x)/"\L$y"^"\L$1"^$1/ie;
but it only works if the replacemen