Help for this page

Select Code to Download


  1. or download this
    my %foo = map { $_ => 1 } @foo;
    
    if ($foo{$bar}) {
       ...
    }
    
  2. or download this
    my %foo;
    undef @foo{@foo};
    ...
    if (exists $foo{$bar}) {
       ...
    }
    
  3. or download this
    if (grep $_ eq $bar, @foo) {
       ...
    }