my @a = (shuffle 1 .. $N)[ 0 .. $E ]; my @b = (shuffle 1 .. $N)[ 0 .. $E ]; my @c = (shuffle 1 .. $N)[ 0 .. $E ]; my @d = (shuffle 1 .. $N)[ 0 .. $E ]; #### my %comp; $comp{ $_ }{a} = 'a' for @a; $comp{ $_ }{b} = 'b' for @b; $comp{ $_ }{c} = 'c' for @c; $comp{ $_ }{d} = 'd' for @d; #### print " : a b c d\n--------------"; #### printf "%4s : %s\n", $_, join ' ', map{ $_||'-' } @{ $comp{ $_ } }{ 'a'..'d' } for sort{$a<=>$b} keys %comp; #### for sort{$a<=>$b} keys %comp; #### @{ $comp{ $_ } }{ 'a'..'d' } #### map{ $_||'-' } #### join ' ', #### printf "%4s : %s\n", $_, #### 6 : a b - d