you could just get md5s before and after. I do something similar with two databases that are supposed to be the same. Unfortunately one is informix and one is sql server
so I bind the columns to hashes, and feed the hashref and the db connection off to a sub which gives me
hashes sums
...snip lots of other code...
use strict; # the obligitory
use warnings; # use strict and warnings
use Digest::MD5;
my $makedigest = \&digestit;
my %ldb = $makedigest->(\%lemployee, $lsth);
my %rdb = $makedigest->(\%remployee, $rsth);
...snip lots of other code...
sub digestit
{
my $dbhash = shift;
my $sth = shift;
my %newdbhash = ();
while ( $sth->fetchrow_arrayref )
{
my $keydata = Digest::MD5->new;
for my $key ( keys %{$dbhash} )
{
%{$dbhash}->{$key} = ''
unless ( defined(%{$dbhash}->{$key}) );
}
$keydata->add(%{$dbhash}->{$_}) for @key;
my $digest = $keydata->hexdigest;
$newdbhash{$digest} = {%{$dbhash}};
}
return %newdbhash;
}
My main reason for doing it this way is that I have NO unique key, so I rely on several columns together to provide me with a unique key. Because the above code is incomplete its probably useless, but the concept is there. Once you have your two hashes ( before and after ) compare the sums.
Ted
--
"That which we persist in doing becomes easier, not that the task itself has become easier, but that our ability to perform it has improved."
--Ralph Waldo Emerson
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.