I tried something. I added a tee to the remote command to log its output in a file (on the host, a different file for each call).
It appears that it is traceroute that is mixing up its outputs on the host; Net::OpenSSH is working fine.

For info, what the recorded file through tee is returning (second line is wrong and belongs to another traceroute call, but the hop number is wrong as well as in the other call, it is hop #1, this ip is never hop #5).
root@HERMES:/tmp/mnt/sda1$ cat test_77.95.71.196.tee traceroute to 77.95.64.123 (77.95.64.123), 6 hops max, 38 byte packets 5 10.2.0.211 8.592 ms 2.467 ms 2.718 ms 2.530 ms 2.561 ms 2.56 +1 ms 2.687 ms 2.749 ms 2.405 ms 2.561 ms 2.562 ms 2.562 ms 6 77.95.70.196 18.432 ms 18.244 ms 18.431 ms 18.119 ms 18.463 m +s 18.213 ms 18.619 ms 18.151 ms 18.369 ms 18.119 ms 18.556 ms +18.682 ms
What the traceroute should return:
root@HERMES:/tmp/mnt/sda1$ traceroute -w 1 -f 5 -m 6 -q 12 -n 77.95.64 +.123 traceroute to 77.95.64.123 (77.95.64.123), 6 hops max, 38 byte packets 5 77.95.71.196 18.806 ms 18.244 ms 18.619 ms 17.995 ms 18.807 m +s 18.463 ms 18.495 ms 18.307 ms 18.744 ms 18.276 ms 18.588 ms +18.307 ms 6 77.95.70.196 18.588 ms 18.276 ms 18.432 ms 18.089 ms 18.588 m +s 18.088 ms 18.463 ms 18.119 ms 18.432 ms 18.151 ms 18.588 ms +18.181 ms

So this traceroute does not work properly when called multiple times at the same time.
Net::OpenSSH output is similar to the one on the tee file, so behaves as expected.


In reply to Re^2: net::OpenSSH several commands, stdout are mixed up by Bolemo
in thread net::OpenSSH several commands, stdout are mixed up by Bolemo

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.