in reply to Howto use hash instance vars?

You might want to read up on Perl references in perlref and maybe one or two of the Perl object tutorials like perltoot. To the problem at hand, it seems like your object already is an anonymous hash, so you can go accessing its members just like you access your instance :

sub printkey { my ($self,$key) = @_; print "$key : ", $self->{my_hash}->{$key},"}\n"; }; # Now set up the faked object. The real one would be # with more meat and a constructor I guess. $self = {}; # $self is an anonymous hash (reference) $self->{my_hash} = {}; # so is $self->{my_hash} $self->{my_hash}->{Hello} = "World"; printkey( $self, "Hello" );