#!perl use strict; use warnings; my @preferred = qw(best good normal bad worst); my @routers = qw (asda adsas asdasds); foreach my $router(@routers){ my $best_of = best_of($router); } sub best_of { my $router = shift; my %available; @available{get_available($router)};# get_available return a list # used as keys of %available ha +sh # for our comfort map { return $_ if exists %avalable{$_} } @preferred; }
In reply to Re: Search an array for values sequentially
by Discipulus
in thread Search an array for values sequentially
by Doozer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |