title: Perl - while (<>) file handling
body: <p>A simple program with <code>while( &lt;&gt; )</code> handles files given as arguments (<code>./program 1.file 2.file 3.file</code>) and standard input of Unix systems.</p>
  
  <p>I think it concatenates them together in one file and work is line by line. The problem is, how do I know that I'm working with the first file? And then with the second one.</p>
  
  <p>For a simple example, I want to print the file's content in one line.</p>
  
  <pre><code>while( &lt;&gt; ){
      print "\n" if (it's the second file already);
      print $_;
  }
  </code></pre>