my %hash = (via => 'test', foo => 'bar'); sub foo { my %args = @_; delete $args{via}; 1; } foo(%hash); print "$_ : $hash{$_}\n" foreach (keys %hash);