How about this (taking Rolf's advice into account):
if( defined $self->{exits} ) { my @rooms = grep { $_ ne 'exit' } values $self->{exits}; return $rooms[ rand @rooms ]; }
In reply to Re: Random Values from Hash with UNLESS statement
by hdb
in thread Random Values from Hash with UNLESS statement
by cmikel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |