Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: Net::SSH2 related query

by lune (Monk)
on Nov 20, 2013 at 14:40 UTC ( #1063537=note: print w/replies, xml ) Need Help??


in reply to Re^2: Net::SSH2 related query
in thread Net::SSH2 related query

Just tried again to reproduce your error. First, I am getting the same result (nothing read), if I set the timeout in the select-function too low, say
#select(undef,undef,undef,0.2); select(undef,undef,undef,0.001);
Maybe You should try a higher one?

Second, it seems, that readline (or <>) is always able to read from the channel (no select necessary). The below code works for me. For you too?

my $chan = $ssh->channel() or die "create channel:$!\n"; $chan->shell() or die("open shell: $!\n"); $chan->blocking(0); $chan->write("ls\n") or die("write to channel: $!\n"); while ( <$chan> + ) { print $_; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1063537]
help
Chatterbox?
[Corion]: holli: Ooof :)
[hippo]: Cut should beless than 20% after tax, though. :-)
[Corion]: hippo: Yeah, but at least two years ago, it still was close enough to 20% cut
[Corion]: But I have a very positive experience with a four day workweek and a three day weekend. I can't easily go back though to full money.
[Corion]: That is easy without having to pay for a house, a wife or children though. If I had any of these, or any two of these, the decision wouldn't be that easy.
[ambrus]: wait. I understand no wife and children, but how do you not have to pay for a house?
[hippo]: I had a low-paid job about 20 years ago and seriously considered going down to a 3-day week. Would have worked 60% of the time for about 80% of the cash.
[Corion]: ambrus: Well, I pay rent, but don't own a house with variable/ unforeseeable costs

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2017-09-21 15:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (249 votes). Check out past polls.

    Notices?