title: How to get input from cat over ssh in Perl
body: <p>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</p>
  
  <pre><code>open(INPUT,"| ssh user@host cat /dir1/dir2/file.dat")
  </code></pre>
  
  <p>but obviously it's only printing the file.dat to the STDOUT.</p>
  
  <p>I know I can probably just scp the file and process it, but...</p>