Using References

sub person_details {
  my %details = (
    surname   => 'Wallaphocter',
    firstname => 'Ignatius',
  );
  return \%details;
}

my $ref = person_details();
print $ref->{surname};