in reply to how to compare two hashes with perl?
Your code would reduce to the following Perlish pseudo-code:
(Coded but not tested. Your compilation may vary....)/usr/bin/perl use strict; use warnings; use Data::Compare; # Note: you probably will have to install this from + CPAN # Load the first hash (bow1) # Load the second hash (bow2) # Now the magic -- my $rc = compare(\%bow1, \%bow2); if ($rc) { print "Equality\n"); } else { print ("The hashes are not equal\n"); } exit(0);
Look at the Synopsis of the Data::Compare module for examples of usage.
----
I Go Back to Sleep, Now.
OGB
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to compare two hashes with perl?
by FluffyBunny (Acolyte) on Nov 04, 2009 at 21:12 UTC |