truckcab
Automotive
- Jul 28, 2008
- 58
Hi,
I have written some Perl scripts occasionally in order to facilitate my job as a CAE-engineer. Everytime I need to sort the results that I have stored in a matrix I have had to make the sorting myself i.e. using some subroutine. However, Id really, really would like to learn how to use the perl function sort. I have read about it at many places and also tried to get it working but I have never ever got it to work for me. Can anyone help me here?
Say that i have a matrix $matrix with $n rows and $m columns and that I want to sort the rows based on what is the number in the second column. How do I do this using teh Perl sort function?
I would be very grateful for any help here!
Best regards
Pierre
Live Long and Prosper !
I have written some Perl scripts occasionally in order to facilitate my job as a CAE-engineer. Everytime I need to sort the results that I have stored in a matrix I have had to make the sorting myself i.e. using some subroutine. However, Id really, really would like to learn how to use the perl function sort. I have read about it at many places and also tried to get it working but I have never ever got it to work for me. Can anyone help me here?
Say that i have a matrix $matrix with $n rows and $m columns and that I want to sort the rows based on what is the number in the second column. How do I do this using teh Perl sort function?
I would be very grateful for any help here!
Best regards
Pierre
Live Long and Prosper !