in reply to basic openssh connectivity

Hi, here are a couple of observations (not on Windows).

Hope this helps!

(*) I don't understand where this array is found and don't have time to deparse the code right now.


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^2: basic openssh connectivity
by choroba (Cardinal) on Jul 26, 2019 at 13:32 UTC
    > I don't understand where this array is found

    It's a global array, because we have $1, $2, $3, and $10 as well; and it exist as a *10 glob with all the possible slots, array being one of them.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

      Thanks choroba I figured it was a global, but didn't think that it would have been defined since no regexp match was attempted. I would have expected to get an error when Perl tried to interpolate it as it was not defined.


      The way forward always starts with a minimal test.
        An array can't be "not defined", it's just empty.
        map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Re^2: basic openssh connectivity
by BrianDStark (Novice) on Jul 26, 2019 at 16:34 UTC

    Hi, thanks so much for the reply. A little background: I am using ActivePerl 5.26.3 build 2603 64 bit. I made a couple of changes based on your comments see below:

    #!/usr/bin/perl use Net::OpenSSH; $Net::OpenSSH::debug = ~0; print "open secure shell\n"; my $ssh = Net::OpenSSH->new('10.0.0.29',timeout => 30, user => 'root', + password => 'viking',port => 22); print "returned from secure shell\n"; $ssh->error and print "Unable to connect: " . $ssh->error; print "Connected to $ssh\n"; undef $ssh;

    Output

    open secure shell # open_ex: ['ssh','-V'] # io3 mloop, cin: 0, cout: 1, cerr: 0 # io3 fast, cin: 0, cout: 1, cerr: 0

    I guess what bothers me is that control never seems to return from the constructor. It goes in, but doesn't come out.

      I should clarify that it doesn't hang in the constructor, the script just ends without returning from the constructor.