in reply to print a hash

TIMTOWTDI (you have not specified the required output): print the structure to a file: use Data::Dumper
use Data::Dumper; open(my $fh,">$file") or die $!; print $fh Dumper(\%uniques); close $fh;


print it to a file like a menu:
sub iter { my $href = shift; my $level = shift; local $_; foreach (keys %{$href}) { if (ref($href->{$_})) { iter($href->{$_}, $level+1); } else { print ' ' x $level; print "$_\n"; } } } iter(\%unique, 0);