my $finalline = "3.2 COMPLIANCE WITH LAWS AND REGULATIONS. While the Product is in its possession or under its, or its sub-contractor's control, THEDUDES shall comply, or ensure that its subcontractors comply, with all applicable federal, state and local statutory and regulatory requirements regarding the manufacture, if applicable, packaging, handling transportation and storage of the Product."; @words = ($finalline =~ /([A-Z][A-Z][A-Z]+)/g); print ("@words \n"); #### COMPLIANCE WITH LAWS AND REGULATIONS THEDUDES #### #!/usr/bin/perl -w use diagnostics; use Spreadsheet::WriteExcel::Big; use HTML::Restrict; use File::Slurp; #use Win32::Word::Writer; use RTF::Writer; opendir(DIR2, "contract/new"); my @files2 = readdir(DIR2); closedir(DIR2); foreach $file2 (@files2) { print "$file2\n"; open (FH2, "contract/new/$file2"); $newfile2=$file2; $newfile2 =~ s/\.html//g; my @filelines2 = ; chomp @filelines2; my $masterplan = join(' ', @filelines2); $hr2 = HTML::Restrict->new(); $masterplan = $hr2->process($masterplan); my @masterarray = split('DUMMY',$masterplan); my $caps = 0; my $traps = 0; my $escape = 0; my @words = ""; #### foreach $finalline (@masterarray){ $escape = 0; $finalline =~ s/\&.{3,5}\;/ /g; $finalline =~ s/\s+/ /g; while ($finalline =~ /(\w\w+\b)/gc){ $linelength++ } if (($finalline =~ /^\s*\d|^\s*Section|^\s*Article|^\s*[A-Z]\.|witness whereof/i) && ($holder == $rtf)){ while ($escape == 0){ if (($finalline =~ /[A-Z][A-Z][A-Z]/) && ($caps == 0) && ($traps == 0)){ print(">>>$finalline<<