title: Read data from each column and finally print it in a row in perl
body: <p>I'm writing a script to read a large file(>10 GB) and write the data from an array to the end of each line in that file. Here is my code</p>
  
  <pre><code>   my $count=0;
     while(my $lines = &lt;$FILE&gt;){
          seek $FILE, length($lines), 1;
          print $FILE "\t", $array[$count];
          $count++;
          }
  </code></pre>
  
  <p>But I think I'm wrong in finding the end-of-line using seek method. I couldn't get my head around this. Can anyone please see whats wrong in this code.  before processing..</p>
  
  <pre><code>my 1st line
  my 2nd line
  my 3rd line
  </code></pre>
  
  <p> After processing....</p>
  
  <pre><code>my 1st line data1
  my 2nd line data2
  my 3rd line data3
  </code></pre>
  
  <p>data1,data2,data3 are in the @array. </p>
  
  <p>Details on the code:</p>
  
  <ul>
  <li>FILE is opened in +&lt; mode (read/write)</li>
  <li>FILE lines are tab delimited. </li>
  <li>@array holds the data1,2...</li>
  </ul>
  
  <p>Issues:</p>
  
  <ul>
  <li>Moving the pointer to end of each line</li>
  </ul>
  
  <p>Thanks,</p>
  
  <p>Robin</p>