in reply to Selecting, matching and counting column elements, using randomly generated numbers
##this bit of the script is not working ### # @uniform = $random_number; # my @temp = map { [ $_[1], $_[0], $_ ] } # step +1 # map { $_->[2] } # step 2 # @uniform;
From the "step 1" and "step 2" comments, I think that you may just be able to reverse those parts.
my @temp = # third, the final results are stored in @temp map { $_->[2] } # second this applies to the results of the fo +llowing: map { [ $_[1], $_[0], $_ ] } # first this applies to @uniform @uniform;
In many cases where folks stack map or grep, they could combine them. The above is the same as
my @temp = map { ($_[1], $_[0], $_ )[2] } @uniform;
which is the same as
my @temp = @uniform;
Did you intend for that portion of code to do something else?
|
|---|