Hi merrymonk,
Did you check out the other replies you got in that thread? For example, a search on PerlMonks as suggested by Corion would have given you, among other things, natural sort on array of arrays (Update: which in turn contains links to other places like How do I do a natural sort on an array?), or salva suggested Sort::Key:
use Sort::Key::Natural qw/natsort/; my @data = qw/blank_5_str_1 blank_5_str_10 blank_5_str_11 blank_5_str_12 blank_5_str_13 blank_5_str_14 blank_5_str_2 blank_5_str_3 blank_5_str_4 blank_5_str_5 blank_5_str_6 blank_5_str_7 blank_5_str_8 blank_5_str_9 /; print "$_\n" for natsort @data; __END__ blank_5_str_1 blank_5_str_2 blank_5_str_3 ... blank_5_str_13 blank_5_str_14
Hope this helps,
-- Hauke D
In reply to Re: Sorting text-number values
by haukex
in thread Sorting text-number values
by merrymonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |