in reply to How to know how much used space of a path?

The "right way" is whatever solves your problem; for a system-specific problem that usually means tying into some part of the system that knows the answer rather then inventing it yourself in pure perl.

For unix, in addition to needing to find out which volume holds the home directory and how much free space it has, you need to find out whether this user has a quota limit (i.e. on a multi-user system). If this is an in-house application where only a few environments are relevant, I'd just shell out to df -k /path. If you need something portable, take a long look around cpan. (surely someone has published something for this in the last 20 years?) If not, congratulations! you found an opportunity to contribute :-)