Guruguhan N wrote: > > Hi , Hello,
> I have an array that is build like this > foreach $i ( 0 .. @array1-1) { > foreach $j ( 0 .. @array2-1) { > $array3[$i][$j] = $array2[$j]; > } > } You can use an array slice to do that: @array3[ 0 .. $#array1 ] = map [ @array2 ], 0 .. $#array1; > The array3 has "m" rows and "n" columns of data. > > This code is written by some one else and I am trying to get the statistics > for each of the column data stored in array3. Before getting the statistics, > I wanted to sort each column data of the array3 in ascending order. I tried > doing it as below, but could not succeed. > > foreach $i ( 0 .. @array1-1) { > foreach $j ( 0 .. @array2-1) { > @array3 = sort {$a <=> $b } @array3; > } > } > > Can some one tell me how do I this? @array3 = map [ sort { $a <=> $a } @$_ ], @array3; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>