if ($st =~ /, CA\b/) { $st =~ s/, CA\b/, California/; print "$st\n"; }