wasii has asked for the wisdom of the Perl Monks concerning the following question:
There must be a long-established idiomatic and elegant perl way to do this -- that I haven't found. I need a statement like:
where $new properly reflects the case of the first letter of $old.s/\b$old\b/$new/g;
Given $old="my"; $new="no"; this would transmogrify
My perl is my life.into
No perl is no life.(I can't include patterns in $new.)
thanks much -
Andy
Back to
Seekers of Perl Wisdom