#!/usr/bin/perl print "bonjour\n"; open(FIC, $ARGV[0]); open(FICC, $ARGV[1]); my @a = (); my @b = (); my $l=0; my $v=0; my $g=0; my $h=0; my $t=0; my $q=0; print "choose the outpu file name\n"; chomp(my $fic2=); open(FIC2, ">$fic2"); #--------------------------------------------------- # initialisation des variables #--------------------------------------------------- $i=0; $j=0; $u=0; $v=0; $t=0; $kk=0; $total=0; while () { my $ligne=$_; $b[$i]=lc($ligne); $i++; } while () { my $ligne=$_; $a[$j]=lc($ligne); $j++; } foreach my $che(@b){ chomp($che); @aa=split(/\s/,$che); $u++; foreach my $kh(@a){ chomp($kh); @bb=split(/\s/,$kh); $v++; $t=0;$total=0; for ($l=0;$l<=$#bb;$l++){ for ($m=0;$m<=$#aa;$m++){ # here compare the word of each line if(($bb[$l] eq $aa[$m]) ){ $t++; $m++; $kk=1; # if the tow termes are identical so $kk=1; goto che } } che: if($kk==1) { #calculate the number of identic terms per line with $number $total++; } $kk=0; } #print the retrieved line print FIC2 "$u: $kh\n"; } $v=0; }