in reply to passing paramters to a sub

You should pass reference to hash:
whatever(\%list,$val); ... sub whatever { my %hash = %{$_[0]}; # my $hash_ref = $_[0]; my $val = $_[1]; ... }
perlsub manual.