sub special_compare { return $a <=> $b if looks_like_number($a) and &looks_like_number($b); return lc $a cmp lc $b; } @argA = sort special_compare @argA;