force comparing when you sort :
foreach $line (sort { (split /:/, $a)[0] <=> (split /:/, $b)[0] } @lis +t){ ...
In reply to Re: Sorting an array of strings by number
by Chady
in thread Sorting an array of strings by number
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |