I'm not in charge of the naming conventions here, I have to take what I can get.
The files are named with leading digits. The digits are good. I'd be happy to keep them in the order of the leading digits.
But my readdir() produces an array in a weird order for two files named with hypens and numbers elsewhere in the string: Here's the stretch from 50 to 60:
50doppelgangland.html
51enemies.html
52earshot.html
53choices.html
54prom.html
57freshman.html
58livingconditions.html
55grad-1.html
56grad-2.html
59theharshlightofday.html
60fearitself.html
Now I've solved my problem by doing a @listoffiles = sort {$a <=> $b} @listoffiles;, and it appears that the spaceship operator parses the files for usable numbers at the start and ignores the rest, so they come out:
50doppelgangland.html
51enemies.html
52earshot.html
53choices.html
54prom.html
55grad-1.html
56grad-2.html
57freshman.html
58livingconditions.html
59theharshlightofday.html
60fearitself.html
so, not really urgent, but what the hell was going on before? It's a LINUX server.
--
($_='jjjuuusssttt annootthheer pppeeerrrlll haaaccckkeer')=~y/a-z//s;print;
In reply to What order do my files come from readdir() in? by Cody Pendant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |