in reply to How to tail file on remote host

tailing through SFTP with Net::SFTP::Foreign:
use Net::SFTP::Foreign; use Fcntl qw(SEEK_END); my $host = ...; my $file = ...; my $sftp = Net::SFTP::Foreign->new($host); $sftp->error and die "Unable to connect to remote host: ".$sftp->error +."\n"; my $fh = $sftp->open($file) or die "Unable to open file $file: ".$sftp->error."\n"; # go to end of file seek($fh, 0, SEEK_END); my $sleep = 1; while (1) { while (<$fh>) { print; $sleep = 1; } sleep $sleep; $sleep++ unless $sleep > 5; }

Replies are listed 'Best First'.
Re^2: How to tail file on remote host
by wmarquette (Initiate) on Oct 01, 2008 at 19:51 UTC
    Im hoping it is easy to install this in my local lib path since I don't have access to the server to install this package.
    
    Thanks for the input.  This looks pretty simple.
    
    
    -Wayne
      The only requirement is that, to handle password authentication, it needs Expect.

      If you use public/private key pairs for authentication exclusively (that's what you should be doing anyway), no additional modules are required.

      Just (recursively) copy the contents of the lib directory to the right place in your server and you are done with the installation!

        Thanks Salva,
        
        
        Yes I would do that except in this case I have not way to copy into the server since I dont have permission to copy anything into the perl5lib directory.   I was doing to put it in my custom lib path somewhere and try this.  I know they have expect stuff installed, but when I did a use on the SMTP package it could not find it.
        
        -Wayne