in reply to Re^2: Respect case in substitution
in thread Respect case in substitution
It will *happen* to work for some invalid inputs. Here are cases that support what I said:
Non-letters in $repl:
my $find= "find"; my $repl= "@@@@"; $_ = "Find"; print; s/\b($find)\b/ uc($repl) | ( $1 ^ uc($1) ) /eig; print; # @``` # Should be @@@@
Non-letters in $find:
my $find= chr(1234) . 'find'; my $repl= "aaaaa"; $_ = chr(1234) . 'FiNd'; print; s/\b($find)\b/ uc($repl) | ( $1 ^ uc($1) ) /eig; print; # AAaAa # Should be aAaAa
|
|---|