in reply to Link methods to hash values
Now ask the real question (see XY Problem).
It looks like you want to return the 'name' property of an object. Assuming that $hash is the object that was blessed to create the object instance then the following is probably what you want:
sub get_name { my $self = shift; return $self->{name}; }
|
|---|