use strict; my %lex; while (my $ligne = ){ chomp($ligne); my @champs = split(/\t/, $ligne); $lex{$champs[26]}{$champs[0]} = 1; } foreach my $p (sort keys %lex){ foreach my $f (sort keys %{$lex{$p}}){ print $f, "\n"; } }