in reply to Solution: Don't know why it works...
in thread IO::Select & ssh problem

By the way, all your LINE lines are being printed to STDERR, since you made that handle the default using select.

Easiest solution: replace

select(STDIN); $|++; select(STDOUT); $|++; select(STDERR); $|++;
with
use IO::Handle; STDOUT->autoflush(); STDERR->autoflush();
or just
$| = 1;

It's useless to set autoflush on an input handle, and STDERR is already autoflushed.

Replies are listed 'Best First'.
Re^2: Solution: Don't know why it works...
by cmv (Chaplain) on Sep 22, 2009 at 12:47 UTC
    ikegami++

    Thanks for pointing this out. I was casting around for anything that might help me, and it didn't occur to me what was actually happening.

    Although I was able to make the above script work, when I replaced the cat /etc/passwd line with a tail -f growingfile line, another problem occurred. The initial output from the tail comes out, but then nothing after that, even as I watch the file grow.

    I'm disappointed that I can't get this to work correctly, and can't figure out what is actually happening. If I can't make any progress today, I'll implement another method. Any suggestions would be appreciated.

    Thanks

    -Craig