Because I guess that if I use Expect with the Net::OpenSSH commands, I have to work with the same incomplete answer as if I were using the commands directly.

You can use Net::OpenSSH to establish the connection to the remote machine and then run an interactive shell managed with Expect as follows:

my ($pty, $pid) = $ssh->open2pty() # and empty command line invokes a +shell! or die "unable to run remote shell"; my $expect = Expect->init($pty); $expect-> ...
Though, if that is all you need to do in the remote server, using Expect alone will be almost the same, the only difference is that you will have to take care of authentication also.
PS: Salva? Betanzos? Super López? I guess I'm not the only Spaniard here!

No, you are not, where are you from?


In reply to Re^3: Retrieving status data from a device with SSH 2 using Perl by salva
in thread Retrieving status data from a device with SSH 2 using Perl by nmorenod

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.