my $rule = File::Find::Rule->start( $path ); while( my $item = $rule->match ) { next if $path eq $item; $size+= -s $item; -f $item and $files++; -d $item and $folders++; } printf "$path: $size: %fMb, Files: %d, folders: %d\n" => $size / 1024**2, $files, $folders;