> To give an idea why this might be useful: I often
> loop, calling a function which returns a list or hash,
> and want to easily check if the list or hash I'm
> getting back is one I have seen already. The following
> doesn't work:
>
> my %seen;
> while(1)
> {
> my @list = some_func();
> die if($seen{\@list});
> $seen{\@list} = 1;
> }
You may have implemented your module this way, but serializing the data
structure with a module like Data::Dumper will get you what you need:
use Data::Dumper;
my %seen;
while(1) {
my @list = some_func();
my $serialized = Dumper(\@list);
die if $seen{$serialized};
$seen{$serialized} = 1;
}
You might want to also look at Storable and FreezeThaw.
--
_______________________________________________________
Ade Olonoh, BOTTLED SOFTWARE
317.576.1120 x12 (phone) 317.576.1135 (fax)
_______________________________________________________