title: Having two different files display their hash keys on the command line and comparing them using Perl
body: <p>I am having difficulty having this program run. .</p>
  
  <p>The first set of code reads from a file that contains data that looks like this: </p>
  
  <pre><code>&gt;name
  AGCTGCA
  </code></pre>
  
  <p>The second set of code reads from a file that contains data that looks like this: </p>
  
  <pre><code>&gt;name 0.05
  </code></pre>
  
  <p>My Perl code</p>
  
  <pre><code>my %sequence_of;
  open(INPUT, $ARGV[0]) or die "Cannot open the file: $!";
  my $hash_key;
  
  my $hash_value;
  while (my $line = &lt;INPUT&gt;) {
     if ($line =~ /^&gt;(\S+)/) {
        $hash_key = $1;
     }
  
     elsif ($line =~ /\S/) {
        chomp $line;
        $hash_value = $line;
        $sequence_of{$hash_key} = $hash_value;
     } 
  }
  
  foreach my $hash_key2 (keys %sequence_of) {
     print "$hash_key2\t$sequence_of{$hash_key2}\n";
  }
  
  #open the second file
  my %name_of;
  open(INPUT_2, $ARGV[1]) or die "Cannot open the file: $!";
  my $hash_key_2;
  my $hash_value_2;
  
  while (my $line = &lt;INPUT_2&gt;) {
     if ($line =~ /^&gt;(\S+)/) {
        $hash_key_2 = $1;
     }
     elsif ($line =~ /\S/) {
        chomp $line;
        $hash_value_2 = $line;
        $name_of{$hash_key_2} = $hash_value_2;
     } 
  }
  
  foreach my $hash_key_3 (keys %name_of) {
     print "$hash_key_3\t$name_of{$hash_key_3}\n";
  }
  </code></pre>
  
  <p>The second part is the one giving me issues. I know there are no syntax errors because it lets me run it, but the second part doesn't print anything.</p>