Perl script to check free disk space

hello,
I have to check the free space on the disk that would work both on Windows and Unix platform e.g on C: \ for Windows and / on Unix. I could use Unix command 'df ' ( my windows system has Unix emulator cygwin and could run 'df ' as well).
But I'd like not to rely on system command but rather on Perl.
Any suggestion how it could be implemented in Perl?
Thanks.

Use File::Find to recurse the disk and add up the file sizes, or detect the operating system and call df or dir as appropriate. The problem with File::Find is that it will not know the capacity of the disk, you will have to provide that data to know the difference between the total file sizes (used space) and the total disk capacity to calculate the estimated free space.