in reply to array games??
Of course this will only return the first array element matching the command.my $cmd = 'south'; my @array = ( 'north#library , 'south#kitchen', 'east#hallway'); my ($location) = map {m/\#(.*?)$/; $1} grep {m/^$cmd\#/} @array || pri +nt "some error message";
my @possibilities = map {} grep {} @array || ...
|
|---|