This sorts the data according to the number in the first field, so pretty much what you're looking for right?@res = sort { int($a) <=> int($b) } <DATA>; print foreach(@res); __END__ 34:dsfalk:as4 2:asd:3425 67:dfa:srkwej9 98:erwvrklj:sek output - 2:asd:3425 34:dsfalk:as4 67:dfa:srkwej9 98:erwvrklj:sek
broquaint
In reply to Re: Sorting an array of strings by number
by broquaint
in thread Sorting an array of strings by number
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |