> For hashes, things get complicated because
> equal hashes may serialize with their keys in
> different orders using Data::Dumper or Storable. 
> FreezeThaw seems to work, though.

Try the following code, slightly modified from the example you gave: 

 
     #!/usr/bin/perl
 
     use Data::Dumper;
 
     for(my $i = 0; $i < 100; $i++) {
         my @list = map {
             chr(rand(254)+1)
         } (0..int(rand(100)));
         my %hash1 = map { $_ => 1 } @list;
         my %hash2 = map { $_ => 1 } reverse @list;
 
         my $serialized1 = Dumper({ map { $_ => $hash1{$_} } sort keys %hash1 });
         my $serialized2 = Dumper({ map { $_ => $hash2{$_} } sort keys %hash2 });
 
         die $i unless($serialized1 eq $serialized2);
     }
 

It sorts the hash keys to reconstruct an anonymous hash for Dumper to serialize in 
which both hash values become equal.  It's a touch more work, but does what you want 
to accomplish.  It also works with Storable.

If you still think your modules will be useful on CPAN, then by all means upload them. 
 I just think that based on the examples of Map::Hash, etc. that you've shown one may 
be able to get more use by applying some of the modules that are already on CPAN or in 
the core.  I typically won't use a CPAN module if I can replicate the functionality it 
offers with one or two lines of code.  The overhead in loading a module, or even in 
learning the interface to another module just doesn't seem worth it.  But then that's 
just me.  Unfortunately this list is so dead sometimes that it's hard to get enough 
feedback to form a consensus.

--

_______________________________________________________

    Ade Olonoh, BOTTLED SOFTWARE

    317.576.1120 x12 (phone)  317.576.1135 (fax)
_______________________________________________________

Reply via email to