use File::Find; my $size = 0; find(sub { $size += -s if $File::Find::name eq "foo/$_" and -f $_}, "foo");