title: Perl, Pattern Matching each element ($line) in an array
body: <p>I have a simple enough problem I think, I have recently ran a script which extracted specific information from the string in each element in an array. I have written this before and it functions well however when trying the very simple version of it right now it will not presen data only the same response uninitialized value argument! I am getting really frustrated as my previous code works. I am clearly doing something STUPID and would love some help!</p>
  
  <pre><code>#!/usr/bin/env perl
  
  use strict;
  use warnings;
  
  
  my@histone;
  my$line;
  my$idea;
  my$file="demo_site.txt";
  
  open(IN, "&lt;$file")||die"\ncannot be opend\n";
  
  @histone=&lt;IN&gt;;
  print @histone;
  
  foreach $line(@histone)
         {
             $line=~ m/([a-zA-Z0-9]+)\t[0-9]+\t[0-9]+\t/;
  
             print$1."\n";
             print$2."\n";
             print$3."\n";
  
         }
  </code></pre>
  
  <p>The infile "demo_site.txt" takes the format of a tab delimited .txt file:</p>
  
  <pre><code>chr9        1234       5678     .     200      .      14.0      -1
  </code></pre>
  
  <p>This file has multiple lines as above and I wish to extract the first three items of data so the output looks as follows.</p>
  
  <pre><code>chr9
  1234
  5678
  </code></pre>
  
  <p>Cheers!</p>