print sort { my ($aa) = $a =~ /(\d+)\s*$/; my ($bb) = $b =~ /(\d+)\s*$/; $bb <=> $aa; } <DATA>; __DATA__ 10.47.147.0 Free: 63 In-use: 99 P_InUse: 61 10.47.147.0 Free: 63 In-use: 99 P_InUse: 65 10.47.147.0 Free: 63 In-use: 99 P_InUse: 70 10.47.147.0 Free: 63 In-use: 99 P_InUse: 69 10.47.147.0 Free: 63 In-use: 99 P_InUse: 63 10.47.147.0 Free: 63 In-use: 99 P_InUse: 66
In reply to Re: Sorting an array of lines
by Juerd
in thread Sorting an array of lines
by Quadzilla
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |