Instead of using complex code to make sort efficient, use Sort::Key which handles that for you without the messy code.
use File::Slurper qw( read_text ); use Sort::Key qw( rikeysort ); print rikeysort { ( /(\d+)%/ )[0] } split /^(?=>>> )/m, read_text( 'try3.txt' );
(Also note the more reliable split pattern.)
Features:
Simplicity.
It's a stable sort, meaning it keeps the relative order of already-sorted items.[1]
And it might be the fastest of all provided solutions.
And it's also the fastest of all the provided solutions!
In reply to Re: schwartzian transform problem
by ikegami
in thread schwartzian transform problem - Solved
by Cristoforo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |