my $s1 = 'xxxyyxxy'; my $s2 = 'yyyxyxx'; my( $m, $o1, $o2 ) = lcssN($s1, $s2, 1); print "$m, $o1, $o2\n"; __END__ Prints: yxxy, 4, 4 But, I expect yyx (as String::LCSS_XS produces). yxxy is not a substring of $s2.