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
PaolaIn reply to Re^2: Problem of context?
by pabla23
in thread Problem of context?
by pabla23
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |