Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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
Domain Nodelet?
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 drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2021-09-17 13:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?