sub printElement { my ( $key, %hash1 ) = @_; print "$key $hash1{$key}\n"; ... printElement( $key, %hash );