Re: [Ssh-sftp-perl-users] net::ssh2 and register_handler
Brought to you by:
dbrobins
|
From: U235Sentinel <u23...@gm...> - 2006-10-06 16:08:45
|
> In NET::SSH::PERL we had a "register handler" method we could call which
> I've used to trigger a subroutine when we receive STDERR traffic. Is
there
> some way to do this with NET::SSH2?
>
> The NET::SSH::PERL module had the following defined for the method:
>
> sub register_handler { }
>
> I'm presuming the code is found elsewhere (maybe this is a regular Perl
> method?)
>
> Any help/tips on where I could follow up on this is greatly appreciated.
> Thanks!
> Not in the same way, but if you look at the poll method you can get stderr
events, and Net::SSH2::Channel lets you read stderr separately
> (see perldoc).
So I would do something like this?
my @subroutine {
print "** Traffic no stderr" if $STDERR;
}
my $trigger=$ssh->poll(250, \@subroutine);
Would this kick off my subroutine when it seens traffic on STDERR?
Basically I'm trying to setup a trigger to do something when it seens
traffic on STDERR. I'm trying to figure out how to use this to run a
subroutine. Am I on the right track with this?
Thanks a bunch!
|