http://qs1969.pair.com?node_id=168976


in reply to Using stat() to get the total size of files in a folder

How about:

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

That will recurse down into subdirectories. If that's not what you want, you could use:

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

-sam