#!/usr/bin/perl use warnings; use diagnostics; my %var = (foo=>"bar"); sub print_foo { my $ref = shift; print %{$ref}->{foo}; } print_foo \%var;