Skip to content

Instantly share code, notes, and snippets.

@kyanny
Created January 7, 2009 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyanny/44214 to your computer and use it in GitHub Desktop.
Save kyanny/44214 to your computer and use it in GitHub Desktop.
#!perl
# $Id$
use strict;
use warnings;
use File::Spec;
use FindBin;
use lib File::Spec->catdir($FindBin::Bin, "..", "lib");
use Getopt::Long;
use Pod::Usage;
GetOptions(\my %opt,
"help",
);
use List::MoreUtils qw(any);
sub _member_of {
my ($atom, $list) = @_;
return any { $atom eq $_ } @$list;
}
use Test::More;
plan 'no_plan';
ok _member_of(1, [1,2,3]);
ok ! _member_of(10, [1,2,3]);
ok any { 1 eq $_ } (1,2,3);
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment