title: perl error: 'use of uninitialized value in concatenation (.) or string' using hash
body: <p>I have a tab-delimited file: abc.txt.
  which has data like:</p>
  
  <pre><code>Pytul_T015270   Protein of unknown function
  Pytul_T015269   Protein of unknown function
  Pytul_T015255   Protein of unknown function
  Pytul_T015297   Protein of unknown function
  </code></pre>
  
  <p>I am creating a parser which takes this abc.txt and 2 other files as input and parses the files by calling different subroutines from a package: <code>utility.pm</code></p>
  
  <p>The subroutine to parse <code>abc.txt</code> is defined in my package, <code>utility.pm</code> goes as follows:</p>
  
  <pre><code>use strict;
  
  sub readblast{
  
  my $fileName = shift;
  my %hash;
  my %geneNameHash;
  
  open PRED, $fileName or die "Can't open file $!\n";
  while (my $line=&lt;PRED&gt;) {
  
      chomp $line;
      #print $line,"\n";
      (my $gene,my $desc) =  split /\t/, $line;
  
      $hash{$gene} = $desc;
  }
  
  close(PRED);
  
  return %hash;
  }
  </code></pre>
  
  <p>And my parser.pl script, which uses the hash is as follows:</p>
  
  <pre><code>my %blast=&amp;utility::readblast($ARGV[2]);
  for my $mRNA(keys %{ $featureHash{$scaffold}{$gene}}){
  my $desc = $blast{$mRNA};
  }
  </code></pre>
  
  <p>Here <code>$featurehash</code> is another hash I made from another file. And <code>$mRNA</code> has the key values of the file <code>abc.txt</code>.</p>
  
  <p>But output of $desc is blank and I am getting error:</p>
  
  <pre><code>Use of uninitialized value $desc in concatenation (.) or string at parser.pl
  </code></pre>
  
  <p>What is wrong with <code>my $desc = $blast{$mRNA};</code> And why won't it store the 2nd column of abc.txt?</p>