# given $x = 'abacad'; # then $x =~ s/a/z/; # returns 1 $x =~ s/a/z/g; # returns 3 $x =~ s/x/z/; # returns empty string, not undef