sub new { my ($class, %arg) = @_; # ... bless { # ... _players => $arg{players} , }, $class; } sub play { my ($self) = @_; my %player; $self->{_players}[0]->out(); # this works # out() is a member function that prints some info about the Player # add key containg ref to 1st player to %player and # with value of a reference to a new anonymous hash $player{$self->{_players}[0]} = {}; foreach my $this_player (keys %player) { $this_player->out(); # this doesn't } }