in reply to Sorting an array of strings by number
force comparing when you sort :
foreach $line (sort { (split /:/, $a)[0] <=> (split /:/, $b)[0] } @lis +t){ ... [download]