#!/usr/bin/perl use strict; use warnings; my %h = qw( a b c d ); func( \%h ); while ( my ( $key, $val ) = each %h ) { print "key is $key val is $val\n"; } sub func { my $incoming_hash_ref = shift; $incoming_hash_ref->{'e'} = 'f'; }