in reply to while (<FH>) always ends with "Couldnt read from remote file: End of file at"

There was a bug I have just fixed on Net::SFTP::Foreign affecting readline when using autodie mode.

Try running your script again after installing the new version 1.88_01 from CPAN.