in reply to Re: Odd perl/ssh interaction
in thread Odd perl/ssh interaction

Agreed regarding strict/warn, error checking, <> and such. The original script had most of that, but I stripped it out as I trimmed down to a minimal test case. Also agree in principle the the Net::OpenSSH suggestion, though I work in an environment where 'extra' modules are not always easily/readily available. They were on my list of possible work-arounds.

Good call on the 'cat' substitution. That definitely highlights the problem. Ultimately '-n' will be the best solution in this case.

Thanks for the help!

Replies are listed 'Best First'.
Re^3: Odd perl/ssh interaction (updated)
by haukex (Archbishop) on Jul 08, 2017 at 13:41 UTC
    I work in an environment where 'extra' modules are not always easily/readily available.

    Note that Net::OpenSSH is a pure-Perl module, and so in the worst case can be installed by copying it over. Only if you need password authentication the XS based module IO::Pty needs to be installed.

    Update:

    Agreed regarding strict/warn, error checking, ... I stripped it out as I trimmed down to a minimal test case.

    The effort to create an SSCCE is appreciated, but it's best to leave those things in when posting questions here, otherwise most monks' first thought will be "how do we know the problem isn't being hidden because those things are missing"? :-)