$a = "this is a test\n"; $a =~ s/t(?!e)/T/g; print $a; $b = "this is a test\n"; $b =~ s/t([^e])/T$1/g; print $b;