my $offset = index( $string, $substring ); substr( $string, $offset, length $substring, '' ) if $offset > -1;