in reply to Re^5: hashes with multiple values per key
in thread hashes with multiple values per key

Hi there,

The output should be like this:

plasmid-plasmid 35 island-plasmid 2 nonisland-island 5 etc
I basically have two lists of paired numbers (in @part1 and @part2), I want to find out where each number in the pair is from (island, plasmid, non-island) based on whether there ids are in the corresponding arrays. I finally want to match each pairs locations (e.g. plasmid-island) to their pair identifier (a number), which are stored in @gp_ids.

Thanks!

Replies are listed 'Best First'.
Re^7: hashes with multiple values per key
by lima1 (Curate) on Apr 04, 2006 at 11:01 UTC
    ok, then simply this?
    while (my($k,$v) = each %hash) { print "$map{$k}-$map{$v->[0]} $v->[1]\n"; }
      ahhh thank you lima1 this has been killing me and now I feel very stupid. kindest wishes