my @list = ( "x10 y", "1abc", "a10y", "x9y", " b1" ); print join "\n", sort dictcmp @list;