Ah, i have a problem. The Data::Dumper shows the same value in the hash key and value. I havent changed the assignment though.

Furter investigation is required.

Here is the call method:

%evals = parseFiles::getEvals(); print Dumper \%evals;

and here is the assignment:

for(my $i = 0 ; $i<scalar @blastLine; $i++) { if ($blastLine[$i] =~ /^>/) { $counter = 0; $current_subject = $blastLine[$i]; chomp ($current_subject); push (@subjects, $current_subject); $alignment->{$current_subject} = ""; ### assignment here for key value#### $evals{$current_subject} = $blastLine[$i]; } $alignment->{$current_subject} = $alignment->{$current_subject}.$b +lastLine[$i]; if($blastLine[$i] =~ /\bScore/) # check to see if the current line points to the e-value { $counter++; my @tempArray = split(",",$blastLine[$i]); # chop the line into an array for processing $tempArray[1] =~ s/(Expect|Expect\(2\))\s=\s//g; #strip off an +y digits,spaces, or = signs to get just e-value if($counter eq 1) { ### assignment here for value#### $evals{$current_line} = $tempArray[1]; } } }

this shows:

$VAR1 = { '>gi|19908487|gb|AF343350.1|' => '>gi|19908487|gb|AF343350.1 +|'

In reply to Re: Hash print problems by MonkPaul
in thread Hash print problems by MonkPaul

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.