I’m trying to cat a remote file over ssh and process it in local script line by line. So far I’ve tried this
open(INPUT,"| ssh user@host cat /dir1/dir2/file.dat")
but obviously it’s only printing the file.dat to the STDOUT.
I know I can probably just scp the file and process it, but…
You’re piping into ssh. I think you want to move the pipe to the other end so you can read the output from that cat command.