Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: How best to compare hash values?

by Khen1950fx (Canon)
on May 06, 2010 at 10:28 UTC ( [id://838676]=note: print w/replies, xml ) Need Help??


in reply to How best to compare hash values?

I tried a variation on your question. What I wanted was a quick "visual" and diff of the arrays. I used Array::Heap and altered the heap.
#!/usr/bin/perl use strict; use warnings; use Array::Heap; use Data::Dumper::Concise; use Text::Diff; use Text::Diff::Table; print "==\n"; my @arr1 = qw[20 20 19 20 18]; make_heap @arr1; print Dumper @arr1; print "==\n"; my @arr2 = qw[19 20 16 19 20]; make_heap @arr2; print Dumper @arr2; print "==\n"; my $file1 = \@arr1; my $file2 = \@arr2; my $diff = Text::Diff::Table->new; $diff = diff $file1, $file2, { STYLE => "Table" }; print $diff, "\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://838676]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-19 23:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found