#!/usr/bin/perl -w use strict; my %h = qw(a b c d); &test(\%h); while ( my ($key, $value) = each(%h) ){ print "Key\t $key Value\t $value\n"; } sub test { my $h = shift; $h->{a}= "k"; ..... Some Code ....... }