How do I read strings into a hash in Perl : <p>I have a file with a series of random A's, G's, C's and T's in them that look like this:</p>

<pre><code>&gt;Mary
ACGTACGTACGTAC
&gt;Jane
CCCGGCCCCTA
&gt;Arthur
AAAAAAAAAAT
</code></pre>

<p>I took those letters and concatinated them to end up with <code>ACGTACGTACGTACCCCGGCCCCTAAAAAAAAAAT</code>. I now have a series of positions within that concatenated sequence that are of interest to me, and I want to find the associated Names that match with those positions (coordinates). I'm using the Perl function length to calculate the legnth of each sequence, and then associate the culmulative length with the name in a hash.
So far I have:</p>

<pre><code>#! /usr/bin/perl -w
use strict;

my $seq_input = $ARGV[0]; 
my $coord_input = $ARGV[1]; 
my %idSeq; #Stores sequence and associated ID's.

open (my $INPUT, "&lt;$seq_input") or die "unable to open $seq_input";
open (my $COORD, "&lt;$coord_input") or die "unable to open $fcoord_input";

while (&lt;$INPUT&gt;) {
    if ($_ = /^[AGCT/) {
    $idSeq{$_

my $id = ( /^[&gt;]/) 

#put information into a hash
#loop through hash looking for coordinates that are lower than the culmulative length

foreach $id
 $totallength = $totallength + length($seq)
 $lengthId{$totalLength} = $id
foreach $position
 foreach $length
  if ($length &gt;= $position) { print; last }

close $fasta_input;
close $coord_input;
print "Done!\n";
</code></pre>

<p>So far I'm having trouble reading the file into a hash. Also would I need an array to print the hash?</p>
