in reply to Need help with efficient processing
You should just push the file name into the array referenced by the hash key when you first find the file. There's no need to go back and read the directories a second time. You can then sort the entries in the array when you process the contents of the hash. If you need the arrays to be sorted in the hash, then just go through your hash keys after directory processing and sort each array.
You might also consider using File::Find or File::Find::Rule instead of readdir.
--- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';
|
|---|