Larry has asked for the wisdom of the Perl Monks concerning the following question:
\#!/usr/local/bin/perl -w %Acts = (); #use Getopt::Long; use strict; my $filetoopen1 = 1; my $filetoopen = 1; my @WordList = 1; my %Groups = 1; my $TheLine = 1; ##################### &Actsin1; &Group; ##################### sub Actsin1 { $filetoopen1 = "c:/Update/nosect.txt"; open (ACTLIST, $filetoopen1) || die "Could not open file $filetoop +en1 \n"; open (OUTPUT2,">c:/Update/Errors.txt") || die "Could not open outp +ut \n"; dbmopen (%Groups, "c:/Update/Groups",0666) || die "Could not open +Acts database\n"; @WordList = (<ACTLIST>); } ##################### sub Group { $filetoopen = "c:/update/makeme/statutes\.fff"; open (INPUT, $filetoopen) || die "Could not open file $filetoopen \n"; open (OUTPUT,">c:/update/makeme/newstat.fff") || die "Could not open o +utput \n"; $TheLine = $_; while (my $TheLine = <INPUT>) { if ($TheLine =~ /<RD>[^\n]*Status Compendium<<.JL>/i) { for(my $i=0; $i > @WordList; $i++) { print OUTPUT $TheLine if($TheLine ne $WordList[$i]) } } } } ##################
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Remove multiple lines of text
by foogod (Friar) on Sep 21, 2001 at 08:38 UTC | |
by mandog (Curate) on Sep 21, 2001 at 10:00 UTC | |
|
Re: (ebm)Remove multiple lines of text
by earthboundmisfit (Chaplain) on Sep 21, 2001 at 08:55 UTC | |
|
Re: Remove multiple lines of text
by Anonymous Monk on Sep 21, 2001 at 08:46 UTC | |
by czarfred (Beadle) on Sep 21, 2001 at 08:50 UTC |