) { tr/A-Z/a-z/ if $opts{ignore}; s/<.+?>//gs; # Note this doesn't handle < or > in comments or js while ( /([a-z\d]{2,})\b/gi ) { my $word = $1; next if $stop_words->{lc $word}; next if $word =~ /^\d+$/ && not $opts{number}; ( $word ) = Text::English::stem( $word ) if $opts{stem}; $index->{$word} = ( exists $index->{$word} ? "$index->{$word}:" : "" ) . "$file_id" unless $seen_in_file{$word}++; } #New Flava: Take Contents out of hash Table and into DB foreach my $words (keys(%index)) { $sth2 = $dbh-> prepare('insert into catalog values ($words, $index{$words})'); $sth2 -> execute(); } } } sub usage { my $usage = <