listing files in a directory by size in perl?

The easiest way would be to open the directory, get all the file names and sizes into a list (or two parallel lists?), and sort the list. You can use opendir and readdir and closedir to get the list, -s to get the sizes, and I would use a Schwarzian Transform to do the sort. (Your teacher will be impressed!)
 
Back
Top