Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Sort directory by file size

by choroba (Archbishop)
on May 18, 2016 at 16:05 UTC ( #1163353=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @sDir = sort { -s "$dir/$a" <=> -s "$dir/$b" } readdir $D1;
    
  2. or download this
    my @sDir = map $_->[0],
               sort { $a->[1] <=> $b->[1] }
               map [ $_, -s "$dir/$_" ],
               readdir $D1;
    
  3. or download this
    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord
    }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1163353]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2021-05-12 08:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (125 votes). Check out past polls.

    Notices?