sub printhash { my $hash = shift; for my $key (keys %{$hash}) { print "$key : $hash->{$key}\n"; } }