Thanks, guys!
The reason why I built up @chrnums and @coords first is because there are also such things as chrX and chrY, so the next step would be to include a small "if" within the code that would push, say, 100 to @chrnums in place of "X" and 101 in place of "Y" for chrX and chrY to be put in the list last.
So I just thought it'd be faster and more readable to do it in two steps.
From what you are suggesting I understand that it is more efficient to build just one sorting criterion instead of two and then ask Perl to sort the thing as a string - am I right? But then, will Perl understand that, say, chr10, should go after chr5?
Thanks again!
In reply to Re^3: Sorting a two-dimensional array by two columns
by a11
in thread Sorting a two-dimensional array by two columns
by a11
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |