1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| my %hash;
open (INTERM, "<xxxx") or die("Impossible d'écrire xxx$!");
while( my $line=<INTERM>){
if($line =~ /(.*)\tTest\tnege\t([0-9]+)\t([0-9]+)\t(.*)\t(.*)\t(.*)\t(.*) (.*) ; (.*) (.*)$/){
my $id=$8;
$hash{$id}{'ge'} =$line;
}
elsif($line =~ (.*)\tTest\t(.*)\t([0-9]+)\t([0-9]+)\t(.*)\t(.*)\t(.*)\t(.*) (.*) ; (.*) (.*)$/){
my $id=$9;
my $nb = { 'deb' => $3, 'ligne' => $line};
push @{$hash{$id}{'ex'}}, $nb;
}
}
my ($id,$structure);
my @tab;
while ( ($id, $structure) = each (%hash) ) {
//le problème vient de cette ligne mais!!
@tab = (sort { $hash{$id}{'ex'}{a}{'deb'} <=> $hash{$id}{'ex'}{b}{'deb'} } @{$hash{$id}{'ex'}});
} |