sub xfer_ssh { my ($xferSessionInfo, @other_args) = (@_); # set something in %xferSessionInfo - note use of the # -> operator to dereference. $xferSessionInfo->{foo} = "bar"; # exactly the same thing, written a way that some find # easier to grok. ${ $xferSessionInfo }{foo} = "bar"; return "ok"; } my %xferSessionInfo; &xfer_ssh(\%xferSessionInfo, @other_args); print $xferSessionInfo{foo}; # prints "bar"