Help for this page

Select Code to Download


  1. or download this
    %BAZ = ( FOO, 1, BAR, 1 );
    %BAZ = ( (FOO) => 1, (BAR) => 1 );
    %BAZ = ( FOO() => 1, BAR() => 1 );
    
  2. or download this
    %BAZ = map { $_ => 1 } FOO, BAR;
    
  3. or download this
    sub is_baz {
        my $i = shift; 
        return ( exists $BAZ{$i} ) ? 1 : 0;
    }
    
  4. or download this
    sub is_baz {
        my $i = shift; 
        return $BAZ{$i};
    }