in reply to Re: Problem of context?
in thread Problem of context?
When i print the entire hash table outside from the "if", it prints only the last element (key) of the hash table for "n" times and i don't understand the reason!use strict; use warnings; use Data::Dumper; open (FILE, "/Users/Pabli/Desktop/gene_association.goa_human"); open (FILE2, "/Users/Pabli/Desktop/go3.obo"); my %go_accession_hash=(); while(<FILE>) { my @array_with_all_fields=split(/\t/); if ($array_with_all_fields[2] eq "TP53"){ my $mio=$array_with_all_fields[4]; %go_accession_hash=($mio,''); } print "".Dumper(%go_accession_hash)."\n"; my @test2= keys %go_accession_hash; } while(<FILE2>){ print "".$test2[0]."\n"; } close FILE; close FILE2;
Thanks for help
Paola
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Problem of context?
by choroba (Cardinal) on Oct 16, 2014 at 09:55 UTC | |
Re^3: Problem of context?
by biohisham (Priest) on Oct 16, 2014 at 13:44 UTC | |
by pabla23 (Novice) on Oct 16, 2014 at 15:30 UTC | |
Re^3: Problem of context?
by Anonymous Monk on Oct 16, 2014 at 21:35 UTC |