Help for this page

Select Code to Download


  1. or download this
    my @words = get_words_to_check();
    
    my %hash = map { $_ => 1 } @words;
    ...
    
    my @good_words = grep { exists $hash{$_} } @words; # Keep the original
    + order
    my @good_words_2 = keys %hash; # Don't care about the original order
    
  2. or download this
    my $index = 0;
    LINE: while (my $line = <>)
    {
    ...
        last LINE if ++$index == @words;
      }
    }