Perlfunc: in_array()

sub in_array {
        my $needle   = shift();
        my @haystack = @_;

        foreach my $l(@haystack) {
                #print "$l => $needle\n";
                if ($l eq $needle) { return $needle; }
        }

        return 0;
}
Leave A Reply
All content licensed under the Creative Commons License