[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Comparing strings the hard way



Jeff Pinyan wrote:
> 
> This is somewhat related to the greatest substring problem 
> 
>   # greatest_common_substring
>   sub gcs {
>     substr($_[0], 0, length(split /[^\0]/, $_[0]^$_[1], 2)[0]);
>   }

Aka "longest common subsequence".  A wait.cpan.org search for "lcs"
found Algorithm::Diff (originally by MJD), which contains an LCS
function.  (Much to my dismay, none of the other CPAN search engines
found it!)

-- 
John Porter

	Voici la langage dans mon couer.


==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe