use File::Find; use strict; foreach my $dir (@ARGV) { my $total; find(sub { $total += -s }, $dir); print "$dir: $total\n"; }