This gives the output you wanted:
$ perl -Mstrict -Mwarnings -MScalar::Util=looks_like_number -E ' my @values = qw{041351920234 Rabbit 0343120 041271024500 0430870 Apple + 041460301399}; say for sort { looks_like_number($a) && looks_like_number($b) ? $a <=> $b : looks_like_number($a) ? 1 : looks_like_number($b) ? -1 : $a cmp $b } @values; ' Apple Rabbit 0343120 0430870 041271024500 041351920234 041460301399
-- Ken
In reply to Re: Sorting Numbers & Text
by kcott
in thread Sorting Numbers & Text
by PriNet
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |