sub foo { my %hash = ( a => 1, b => 2 ); return wantarray ? %hash : \%hash; }