in reply to Regex Substitution in sub
If your intent is to do no more than one substitution, then you need program logic to return after a substitution has been made. Something like
might be what you're looking for.$_[0] =~ s/foo/bar/ && return;
By the way, the /o isn't helping you in the slightest.
|
|---|