@a = (2, 10, 1); sort {$a <=> $b} @a would give you (1, 2, 10), when sort {$a cmp $b} @a will give you (1, 10, 2)