in reply to Is list member
Is that the right way, or there's a better or correct one?sub isListMember { my ($array, $item) = @_; # array ref, item for (@{$array}) { if (/^\d+$/) { return $TRUE if ($_ == $item); } else { return $TRUE if ($_ eq $item); } } $return $FALSE; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Is list member
by davorg (Chancellor) on May 06, 2002 at 09:19 UTC |