$a="qwe"; $a =~ s/(\w)/ $1 ne "w" ? $1 : croak "w is bad" /ge;