in reply to Testing if a string is a substring

That is what index is made for:

sub is_subst { my ($string, $subst) = @_; -1 != index( $string, $subst); }
You may just want to call index directly, since it returns the location in $string of the first match.

After Compline,
Zaxo