for $mega( sort{ $a->[1] <=> $b->[1] } @megaMotif ) { print @$mega; push (@megaMot, [@$mega]); }