sub reversehash { my %h; push @{$h{$_[0]->{$_}}}, $_ for keys %{$_[0]}; $h{$_} = join '|', @{$h{$_}} for keys %h; return \%h; }