Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2015-11-25 01:50 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (667 votes), past polls