Help for this page

Select Code to Download


  1. or download this
    use strict; use warnings;
    use List::Util 'all';
    ...
    if ( $all_found ) {
        ...
    }
    
  2. or download this
    my %hash = @allwords; #puts array in hash to search / compare.
    
  3. or download this
    @array = ('foo', 'bar', 'baz', 'qux');
    %hash = map { $_ => 1 } @array;
    
  4. or download this
    if (exists $hash{'word1' && 'word2' && 'word3'}) {
       ...do stuff ;
    }
    
  5. or download this
    if ( exists $hash{'foo'} and exists $hash{'bar'} ) {
        ...
    }
    
  6. or download this
    if ( grep { $_ eq 'word1' && 'word2' } @allwords ) {
        ...do stuff; 
    }