http://www.perlmonks.org?node_id=54267
Description: pass this subroutine the path (can be a UNC path!) and it will return the amount of disk space that the folder (and its subfolders) use in bytes.

I was previously using a couple of subs in a very confusing loop, but this is neater, and faster I hope.
use File::Recurse;

sub GetFolderSize {
    my $Path = shift;
    my $size = 0;

    recurse { $size += -s } $Path;

    return $size;
}