in reply to sorting a directory

You can open the directory with opendir, and read it with readdir. push the filenames into an array of arrays (see perllol) along with their filesizes (determined by the -s operator, discussed in perlfunc under the -X heading). And then sort the AoA based on the file sizes using sort. If you want to end up with only the list of filenames (discarding the file sizes), map can be used to transform back to a flat array.


Dave