<?xml version="1.0" encoding="windows-1252"?>
<node id="1009920" title="Re: Is it possible to find the matching words and the percentage of matching words between two texts?" created="2012-12-21 09:55:29" updated="2012-12-21 09:55:29">
<type id="11">
note</type>
<author id="1001958">
karlgoethebier</author>
<data>
<field name="doctext">
&lt;code&gt;
#!/usr/bin/perl

use strict;
use warnings;
use Set::Scalar;

# use Data::Dumper;

my @str1= qw(Poet Blake had a milky white cat He used to call it Pussy);
my @str2 = qw(Poet Blake had a white cat and used to call it Pussy);

my $s1= Set::Scalar-&gt;new(@str1);
my $s2 = Set::Scalar-&gt;new(@str2);

my $result = $s1*$s2;

print $result;

__END__

(Blake Poet Pussy a call cat had it to used white)

&lt;/code&gt;

&lt;p&gt;See [cpan://Set::Scalar]&lt;/p&gt;

&lt;p&gt;Perhaps this helps. Best regards, Karl&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Update:&lt;/b&gt; You wrote you are a teacher. So i think you can do the math by yourself ;-)&lt;/p&gt;&lt;p&gt; Regards, Karl, Earl of &lt;a href="http://de.guttenplag.wikia.com/wiki/GuttenPlag_Wiki"&gt;GuttenPlag&lt;/a&gt;.&lt;/p&gt; &lt;p&gt; P.S.: And [man://diff] might be a weapon too...&lt;/p&gt;

&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-1001958"&gt;
&lt;p&gt;«The Crux of the Biscuit is the Apostrophe»&lt;/p&gt;

&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
1009885</field>
<field name="parent_node">
1009885</field>
</data>
</node>
