$hash{name} = {date => "00-22-00", city=>"Chicago",}; function (\%hash1); function (\%hash2); #### sub function { my %hashref=%{shift()}; #the below works ok print $hashref{name}{city},"\n"; # but adding to the hash doesn't work if I print out # the entire hash outside this function $hashref{name}={data1=>"moredata",}; # it does work if I print it out inside the function }