#!/usr/bin/perl use warnings; use strict; # Simple alpha sort produces wrong numeric order here my @test = (qw/1 12 10 100 /); @test = sort @test; print "@test\n"; #prints "1 10 100 12" # With leading zero'es, we get "right" numeric answer @test = (qw/001 012 010 100/); @test = sort @test; print "@test\n"; #prints "001 010 012 100"