in reply to Hashes in Objects

The above replies gave the answer. Here's a little more context:

sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = { }; $self->{token} = { a => 5 }; # equivalent to $self->{token} = \%( a => 5 ); return bless($self, $class); }
Minor changes required to your accessors:
sub set_token { my $self = shift; $self->{token}{$_[0]} = $_[1]; } sub get_token { my $self = shift; return $self->{token}{$_[0]}; } sub get_token_keys { my $self = shift; return keys %{$self->{token}}; }
Take out the single quotes, especially around the things you need to evaluate (such as $_[0]). Perl used to require quotes on those keys which are barewords, but does not anymore.

--
[ e d @ h a l l e y . c c ]