in reply to putting the return value from defined for one hash as the value in another

Moron,
I suspect your problem isn't where you think it is. Do you get the expected results when you run:
#!/usr/bin/perl use strict; use warnings; my (%ilb, %abs); for my $key (qw/foo bar baz/) { $abs{$key} = {}; } for my $key (qw/blah baz asdf/) { $ilb{$key} = {pos => $key, abs => (defined $abs{$key} ? 1 : 0)}; }
If you do, then the problem is not in your logic but your data.

Cheers - L~R

  • Comment on Re: putting the return value from defined for one hash as the value in another
  • Download Code

Replies are listed 'Best First'.
Re^2: putting the return value from defined for one hash as the value in another
by Moron (Curate) on Apr 18, 2007 at 21:35 UTC
    Yes, now I get the 1's appearing - thx that means I can move on with this work. My remaining surprise is that I didn't get a true value without forcing one on it.
    __________________________________________________________________________________

    ^M Free your mind!

    Key to hats: ^I=white ^B=black ^P=yellow ^E=red ^C=green ^M=blue - see Moron's scratchpad for fuller explanation.