This script from the Net::SFTP::Foreign distribution shows how to emulate a tail -f over SFTP.
In reply to Re: Disconnect from Remote Server by salva in thread Disconnect from Remote Server by rfbits