in reply to extended problem
in thread hash of lists - hash of hashes

this is actually what i finally came up with:

my ($key, $value, $len); while (($key, $value) = each %HoL) { my $href = $HoL{$key} = { map {$_, 1} @$value }; do { $len = keys %$href; for (@HoL{@$value}) { if (ref eq "HASH" ) { @$href{keys %$_} = (1) x (keys %$ +_) } elsif (ref eq "ARRAY") { @$href{@$_} = (1) x @$_ } } $value = [ keys %$href ]; } while (@$value > $len); }
it's iterative no less. any comments?

Replies are listed 'Best First'.
RE: RE: extended problem
by visnu (Sexton) on Jun 14, 2000 at 03:32 UTC
    on second run, this code is crack-headed. it ends up modifying the top level hash that it's iterating over and runs into bad stuff.
RE: RE: extended problem
by visnu (Sexton) on Jun 13, 2000 at 11:40 UTC
    note: that's me forgetting to login, up there posting..