in reply to using File::Find for reading files in order

I'm just curious here.. Why do you think
File 1
File 10
File 100
File 2
File 20
File 21
Is out of order? Or strange at all?

It's obviously sorted alphanum.
You expected to sort by comparison, by.. is two greater than, 100. It's not greater ammount, but 100 does come before 2 alphanumerically. Just wanted to point that out- because this is a bug in the coder, not the code.

If you want to be able to sort files like these as you expect, one thing to do is name them appropriately...

# rename ' ' ' 00' File\ ?; rename ' ' ' 0' File\ ??
# ls -1 File\ *
File 001
File 002
File 010
File 020
File 021
File 100
  • Comment on Re: using File::Find for reading files in order