if (defined($data{$f1}{$f2}{'data'} { my (%uniq); foreach (@{$data{$f1}{$f2}{'data'}) { $uniq{$_}++; } $v4 .= join( ':', sort(keys(%uniq)) ); }