my %hash=(a=>1,b=>2); my $x=&foo(\%hash); sub foo{ my $h=shift; #hash reference #I want to clear out the hash here... $h->{c}=5; return 1; }