Help for this page

Select Code to Download


  1. or download this
    my @invalid_list = qw< John Simon Mathias Aerith Bob >;
    my @test = qw< Alice Bob John Doe >;
    
    ...
    {
      print "$name\n" unless exists $invalid{$name};
    }
    
  2. or download this
    use List::Util qw( none all any );
    for my $name (@test)
    {
    ...
      print "Any  > $name\n" unless any { $name eq $_ } @invalid_list;
      print "All  > $name\n" if all { $name ne $_ } @invalid_list;
    }