Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: du with backticks

by snoopy (Deacon)
on Mar 20, 2008 at 01:18 UTC ( #675139=note: print w/ replies, xml ) Need Help??


in reply to du with backticks

Maybe it's time consider refactoring this via CPAN modules? For comparison, the following achieves a similar result, using File::Find::Rule and Filesys::DiskUsage:

#/usr/bin/perl use warnings; use strict; use Filesys::DiskUsage qw/du/; use File::Find::Rule; use YAML; my $rule = File::Find::Rule->new; $rule->directory(); $rule->not($rule->new->name( qr/^.*Maildir.*(cur|new|courierimapkeywor +ds)$/)); my @dirs = $rule->in('.'); warn "dirs=@dirs"; my %sizes = du( { 'make-hash' => 1, 'human-readble' => 1, } , @dirs); print YAML::Dump(\%sizes);


Comment on Re: du with backticks
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2014-08-30 11:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls