in reply to Sorting based on filesize.
If so, and if RAM is cheaper than stat calls, then
a hash of filenames keyed on sizes could be used instead.@files = grep { -f } glob '* .*'; @hash{ (map { -s $_ } @files) } = @files; @files = @hash{ sort { $a <=> $b } keys %hash }; print map {$_,$/} @files;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sorting based on filesize.
by graff (Chancellor) on Jul 20, 2004 at 04:40 UTC | |
by keszler (Priest) on Jul 21, 2004 at 12:02 UTC |