in reply to searching a list
A hash provides the best way I know to search,
my %hash; @hash{'abc', 'dog', 'cat', 'rabbit', 'attic'} = (); for (qw/cat at play with rabbit/) { print $_, " is ", exists($hash{$_})? '', 'not ', 'in the list', $/; }
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |