in reply to Re: Re^3: hash referencing...best approach?
in thread hash referencing...best approach?

You don't need $user as part of your key, since $session_id is unique. If you want to retrieve something, store it in the value part of the hash. The key is for stuff you want to look up by. So:
$session_hash{$session_id} = [$dept_code, $user]; #array ref
and in write_id, the magical print will be
print DATA join(',', @$output), "\n"; # Or something like that
Review perldoc perlreftut to get a better handle on how complex data structures are built in Perl.

The PerlMonk tr/// Advocate