http://qs1969.pair.com?node_id=689026


in reply to sorting files

It could be ok, it depends on what you are expecting it to do...

As you have written you are extracting only the "02" part of the filename in $first_number and the "20061022" part in $second_number. I don't really believe it is what you meant to do :)

Please better explain what you are trying: in the example filename there are 4 numeric parts and you should at least decide the order of precedence between them (which are to be sort before). Secondly, if the format of the string is known (length of the numeric parts, for instance) there could be efficient ways than in the generic case.

Rule One: Do not act incautiously when confronting a little bald wrinkly smiling man.