in reply to Removing duplicate values for a hash of arrays
This relies on having some separator, 'x' that is sure not to appear in your data. YMMV
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my %hash = ( a => ['1', '2'], b => ['2', '3'], c => ['1', '2'] ); my %temp = map {(join 'x', @{$hash{$_}}) => $_} keys %hash; my %d_duped = map {$temp{$_}, [split 'x', $_]} keys %temp; print Dumper \%d_duped;
Cheers,
R.
|
|---|