I've stumbled across a problem with Net:SSH2 stat()-ing large files via sftp. When a file exceeds 4095MB, stat() fails to correctly report the file size. Instead a size of 0 or 18446744071562067968 is shown. See  for the simple test.
I guess the type returned by libssh2 is not properly converted. In the library the type libssh2_uint64_t is used to hold the file size, which is a typedef to unsigned long long: