in reply to Changing case inside substitution

Using the e regexp modifier, you can execute code in the replacement part. Consider:
my $str = 'Abc Abc'; $str =~ s/(\w+)/lc($1)/ge;
The result would be 'abc abc'.

Hope this helps, -gjb-