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 replacement string is of the same length.

--
dave


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to