cowgirl has asked for the wisdom of the Perl Monks concerning the following question:
I would like to sort it with these rules:@Array[0] = "1,5"; @Array[1] = "6,2"; @Array[2] = "3,4"; @Array[3] = "3,9"; @Array[4] = "8,1";
Thus you would get this as a result:* Element 1 of string should be Low to High * Element 2 of string should be High to Low
I know basic sorting but this goes too deep for me. In addition, is it bad to use the array to put strings with two 'artifical' elements. Is there another way to do it more efficient like:@Array[0] = "1,5"; @Array[3] = "3,9"; @Array[2] = "3,4"; @Array[1] = "6,2"; @Array[4] = "8,1";
and so forth? If so, how would I be able to sort this with the same rules? Thanks a million PerlMonks!$array->[0]->x=1; $array->[0]->y=5; $array->[1]->x=6; $array->[1]->y=2;
|
|---|