in reply to Problem using object references as hash keys
In the new method couldn't you map the players into an AofH with something like the following.
_players => [ map { { Player => $_ } } @$arg{players} ],
Then you could access it below with
$self->{_players}[0]->{Player}->out(); # this works
Then you would be storing the object reference in the Player key and would be able to use that same hash to store other state data however you felt neccessary.
$self->{_players}[0]->{Score} = 100;
|
|---|