Harry Putnam wrote:
Shawn H Corey <shawnhco...@gmail.com> writes:

Harry Putnam wrote:
But, is there an easier way?
Invert both hashes and find the keys in both inverses.

[...]

Thanks for the nice working script... Lots to learn there.

But not sure how to get at the information I asked about with it. Maybe because there was a type in my post.

Harry wrote:
The idea is to determine what is one hash but not the other in terms
                                  ^
                                  in
of values ... as above.



Harry Putnam wrote:
> Have quite a lot of trouble getting my pea brain around working even
> with simple hashs.
>
> What I hope to do is compare hashes and a few different ways.
>

If you want to find those in one but no the other, change the if:

for my $name ( keys %inverse_h1 ){
  if( exists $inverse_h2{$name} ){
    # print "$name exists in both hashes:\n",
# Data::Dumper->Dump( [ $inverse_h1{$name}, $inverse_h2{$name} ], [ 'h1', 'h2' ] ),
          # "\n";
  }else{
    print "$name exists in only h1\n";
  }
}


--
Just my 0.00000002 million dollars worth,
  Shawn

Programming is as much about organization and communication
as it is about coding.

I like Perl; it's the only language where you can bless your
thingy.

Eliminate software piracy:  use only FLOSS.

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to