#!/usr/bin/perl use strict; use warnings; my $file1 = <); #open my $outFile, '>', $fic2 or die "Can't create $fic2: $!\n"; my @aLines; while (my $ligne = <$inA>) { chomp $ligne; push @aLines, lc($ligne); } while (my $che = <$inB>) { chomp $che; my @bWords = split(/\s/, $che); foreach my $kh (@aLines) { my @aWords = split(/\s/, $kh); my $total = 0; for my $bWord (@bWords) { my $matched; for my $aWord (@aWords) { $matched = $bWord eq $aWord; last if $matched; } $total++ if $matched; } #print the retrieved line #print $outFile "$.: $kh\n"; print "$.: $kh\n"; } }