http://www.perlmonks.org?node_id=1104053


in reply to Re^2: Problem of context?
in thread Problem of context?

Are all the entries in the fifth column of my $mio=$array_with_all_fields[4] unique ?

If the answer is "yes" then your hash can be re-written as has been suggested to you (i.e.  %go_accession_hash{$mio}=' ';). If the answer is "no" then you might want to consider using an advanced data structure that is more appropriate to capture each variation associated with $mio.

In order to help you understand the problem and solution better It will be more useful to actually show a representative example of how your data look like and what you want to achieve from reading it in.


A 4 year old monk

Replies are listed 'Best First'.
Re^4: Problem of context?
by pabla23 (Novice) on Oct 16, 2014 at 15:30 UTC
    Thanks so so so much for your help! The situation is complicated and i'm new in "Perl"! Then: if i print "array_with_all_fields4" this is my output:

    GO:0000060 GO:0000122 GO:0000979 GO:0001077 GO:0001701 GO:0001756 GO:0001836 GO:0002309 .....

    After i store this output into "mio" for a particular need. After i store "mio" into an hash table as the keys of the hash table. If i print the hash table this is the output:

    $VAR1 = 'GO:0000060'; $VAR2 = ''; $VAR1 = 'GO:0000122'; $VAR2 = ''; $VAR1 = 'GO:0000979'; $VAR2 = ''; $VAR1 = 'GO:0001077'; $VAR2 = ''; $VAR1 = 'GO:0001701'; $VAR2 = ''; .....

    the final step for me is to store keys into an array "test2" and after use this array in another "while" and in another "FILE2".

    I know that is so difficult to explain but if you want i can write to you from my personal mail!

    Thaks a lot Paola