in reply to hash referencing...best approach?

You are referencing the hash to $s, which is local.
You could pass in a ref to $sid, or return the hash ref. I prefer the later.

Also you are assigning a hash ref to a hash, which is probably what you don't want. {} creates a hash reference, () are used to define a hash.

One of these 2 options should work:
#Passing scalar ref sub make_session { my ($u,$a,$s)=@_; my $session_hash={ user=>$u, dept=>$a }; $$s=$session_hash; } &make_session($user,$dept,\$sid);
or
#Returning hash ref sub make_session { my ($u,$a)=@_; $session_hash={ user=>$u, dept=>$a }; return $session_hash; } $sid = &make_session($user,$dept);
Update: Changed %session_hash to $session_hash after realizing that you are creating a hash ref by using {}.

- Tom