It looks like you are using Windows, and I'm guessing ActiveState, which I believe was compiled 32-bit, so your maximum integer is 2**32, which is less than the value in $TotalNumberOfFreeBytes
You probably need to use Math::BigInt or pursue another design path.