http://www.perlmonks.org?node_id=951409


in reply to Fastest way to calculate directory size in linux

If all you care about is the size of the directory, just use stat:

$ perl -e 'print +(stat("/tmp"))[7]' 49152

I have no idea whether stat() works on Windows or not, but it's not mentioned in perlport.