print OUTFILE "$line_1"; my $meter = $length_1; if (defined $aircraft_id_1){ ################### OPEN THE SECOND INFILE ############################ open(INFILE_2,"<${file_2}") or die "Can't open ${file_2} : $!"; ################################################################# while (my $line_2 = ){ chomp($line_2); my @Elements_2 = split(/;/, $line_2); # warning : in this file, the aircraft_id looked for is in the first column my $aircraft_id_2 = $Elements_2[0]; # print STDOUT "the aircraft_id in the resemblance_criterion_file is : $aircraft_id_2\n"; if ($aircraft_id_1 eq $aircraft_id_2){ print OUTFILE ";$line_2\n"; } } close INFILE_2; }