in reply to Get disk usage without modules

without using any outside module
Why? I doubt this is because you can't run someone else's code because that's what you are asking for. And since Filesys::DiskUsage is pure perl, it just happens to be perl code that does exactly what you want, you can access the source (less than 200 lines of code, if you don't count File::Basename), and get your inspiration from there, or even copy the whole thing and remove what you don't need. The fact that it is a module just means that you can also install it through CPAN, and there's a big chance that it has been better tested than code someone would give as an answer to your request.