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

ok, I can't see the keys 1 and 138, which you would need for the Dumper output of %hash. check @gp_ids and @plasmid_ids. what should be the output? hard to help you as we can't know what your code should do.
  • Comment on Re^5: hashes with multiple values per key

Replies are listed 'Best First'.
Re^6: hashes with multiple values per key
by Anonymous Monk on Apr 04, 2006 at 10:43 UTC
    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!

      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