in reply to redirection of output

You may want to see about using Net::Telnet to do this as well. This would let you connect and log in to the remote machine remotely. You could then use object methods to execute the command you want, and retrieve data line by line if necessary.

I personally consider this somewhat of a kludge, but this is probably the solution requiring the least amount of coding on your part. I would go with some of the other recommendations here, involving real TCP client-server interaction, but Net::Telnet should suffice.