Is there some compelling reason the binary won't do the job you need? For huge files like that, I guess I'd just
system('scp', $host, $file, $etc) the transfer rather than trying to do it in native perl. Hrm, actually, it looks to me like
Net::SFTP::Foreign forks an binary ssh anyway, so the slowness may be in the module — and probably isn't related to the slowness of
Net::SFTP which is slow for different reasons.