I thought that you had to have a key for every value in a hash - I would have never thought of making the key a reference to an anonymous array. Those questions got me thinking as well, if I ever do make version 3.0 I'll put the answers in that.
The thing I don't understand is how you get it to return the value of the array:
my $game_aref = $games{$mood}; my $randgame = ${ $game_aref }[ rand @{ $game_aref } ]; print "You should play: $randgame\n";
Way over my head, any explanation would be welcome :)
In reply to Re^2: Decisiveness for Gamers
by Panda
in thread Decisiveness for Gamers
by Panda
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |