in reply to Returning More Than One Hash

maybeD,
There are many ways of trouble shooting weird mysterious problems. Sprinkling print statements everywhere is often a favorite (have you verified the hashes are correct before you return them?). One that I often reach for is starting with a known quantity and add pieces gradually until it stops behaving as I would expect. So, that is what I suggest here:
#!/usr/bin/perl use strict; use warnings; my ($href1, $href2) = gen_hrefs(); sub gen_hrefs { my %h1 = (one => 1, two => 2, three => 3); my %h2 = map {$_ => ord($_) } 'a' .. 'z'; return (\%h1, \%h2); }
Once you see that does exactly as you expect, modify it little by little to look like your actual code and see where it breaks.

Cheers - L~R

Replies are listed 'Best First'.
Re^2: Returning More Than One Hash
by maybeD (Sexton) on May 30, 2007 at 13:13 UTC
    I've done that, and I think I have identified the problem, thanks to your suggestions.
      Now come on, don't leave us in suspense! Your original code looked ok (unless I missed something), so what was wrong with it???