http://www.perlmonks.org?node_id=659792

flaviusm has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I am using String::LCSS module to find the longest common substring of two strings and I don't get the result I am expecting. Can anybody tell me what am I doing wrong? Thank you.

#!/usr/bin/perl require String::LCSS; $s1 = '1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 18 19 20 21 22 23 7 + 24'; $s2 = '1 2 3 4 5 7 8 9 11 12 13 10 14 15 16 17 2 18 19 20 21 22 23 7 2 +4'; $result = String::LCSS::lcss ($s1, $s2); print $result;

I am expecting to get "14 15 16 17 2 18 19 20 21 22 23 7 24" but I get instead " 11 12 13 1"