Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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 musing on the Monastery: (2)
As of 2014-09-17 02:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (56 votes), past polls