in reply to Respect case in substitution

Something like:
s/\b(find)\b/$1 eq uc($1) ? "REPL" : $1 eq ucfirst(lc($1)) ? "Repl" : +"repl"/gie
or more flexibly:
my %repl = ( find => 'repl', FIND => 'REPL', Find => 'Repl', ); s/\b(find)\b/$repl{$1}||$repl{lc $1}/gie