# Create a list of files/documents that haven't been # compared to the rest of the documents my @new_docs = $foo->get_new_documents(); my @old_docs = $foo->get_old_documents(); # Process my $Compare = Text::Compare->new( memoize => 1 ); foreach my $new_doc ( @new_docs ) { $Compare->first( $new_docs ); foreach my $old_doc ( @old_docs ) { $Compare->second( $old_doc ); $foo->save_similarity( $new_doc, $old_doc, $Compare->similarity() ); } }