my $hash = { a => 'b' }; sub foo { print $_[0], "\n"; return $hash; } print foo('abcd')->{a};