in reply to comparing sentences

Just pick a reasonable value to test $ratio against (like maybe 1.0):

#!/usr/bin/perl # http://perlmonks.org/?node_id=1174957 use strict; use warnings; use Algorithm::Diff qw(traverse_sequences); my $template = <<END; The earliest conceptualization of human rights is credited to ideas ab +out natural rights emanating from natural law. In particular, the iss +ue of universal rights was introduced by the examination of extending + rights to indigenous peoples by Spanish clerics, such as Francisco d +e Vitoria and Bartolomé de Las Casas. In the Valladolid debate, Juan +Ginés de Sepúlveda, who maintained an Aristotelian view of humanity a +s divided into classes of different worth, argued with Las Casas, who + argued in favour of equal rights to freedom from slavery for all hum +ans regardless of race or religion. END my $copywitherrors = <<END; The earliest conceptulization of human rights is credited to ideas abo +ut rights emanating from natural law. In particular the issue of univ +ersal rights was introduced by extending rights to indigenous peoples + by Spanish clerics, such as Francisco de Vitoria and Bartolomé de La +s Casas. In the Valladolid debate, Juan Ginés de Sepúlveda, who maint +ained an Aristotelian view of humanity as divided into clases of diff +erent worth argued with Las Casas, who argued in favour of equal righ +ts to freedom from slavery for all humans regardless of race. END my $somethingelse = <<END; Although ideas of rights and liberty have existed in some form for muc +h of human history, there is agreement that the earlier conceptions d +o not closely resemble the modern conceptions of human rights. Accord +ing to Jack Donnelly, in the ancient world, "traditional societies ty +pically have had elaborate systems of duties... conceptions of justic +e, political legitimacy, and human flourishing that sought to realize + human dignity, flourishing, or well-being entirely independent of hu +man rights. These institutions and practices are alternative to, rath +er than different formulations of, human rights".14 The history of hu +man rights can be traced to past documents, particularly Constitution + of Medina (622), Al-Risalah al-Huquq (659-713), Magna Carta (1215), +the Twelve Articles of Memmingen (1525), the English Bill of Rights ( +1689), the French Declaration of the Rights of Man and of the Citizen + (1789), and the Bill of Rights in the United States Constitution (17 +91) END sub compare { my ($old, $new) = @_; my $changes = 0; traverse_sequences( [ split //, $old ], [ split //, $new ], { DISCARD_A => sub { $changes++ }, DISCARD_B => sub { $changes++ }, } ); return $changes; }; my $length = length $template; print "length: $length\n"; my $answer = compare($template, $copywitherrors); my $ratio = $answer / $length; printf "copywitherrors: %d ratio %.3f\n", $answer, $ratio; $answer = compare($template, $somethingelse); $ratio = $answer / $length; printf "somethingelse: %d ratio %.3f\n", $answer, $ratio;