title: pipeline input data
body: <p>I need to write a program that works with input from either a file or the shell (for pipeline processing). What is the most efficient way to deal with this? I essentially need to read the input line by line, but the input might be the output of another program from shell, or a file.</p>
  
  <p>Thanks</p>