in reply to array games??

Probably you should use hashes for this kind of data structures, but if you want to use the array method you could do something like:
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";
Of course this will only return the first array element matching the command.
If the command is not unique do something like:
my @possibilities = map {} grep {} @array || ...

--
Jaap Karssenberg || Pardus (Larus)? <pardus@cpan.org>
>>>> Zoidberg: So many memories, so many strange fluids gushing out of patients' bodies.... <<<<