Help for this page

Select Code to Download


  1. or download this
    my $matches = 0;
    foreach my $item (@items) {
      $matches++ if grep( $item eq $_, @list );
    }
    print "All match!" if $matches == @items;
    
  2. or download this
    my %st = map { $_ => undef } @list;
    my $matches = 0;
    ...
      $matches++ if exists $st{$item};
    }
    print "All match!" if $matches == @items;
    
  3. or download this
    use List::AutoST;
    my $list = List::AutoST->new();
    ...
    
    # or (also via overload)
    print "Ok!" if exists $list{'this value'};