A few more things:

  1. First off, after you use strict; like dragonchild recommended, you will notice that @WordList isn't scoped properly. Also, while you have the right idea towards good, modular code by using functions, your functions need to be... functionized. The first one, actsin1, doesn't even really need to be a function at all. In fact, if it wasn't a function, you would no longer have any scoping problems associated with @WordList. Your The second one, Group, should accept the array as an argument. Keeping a tight scope is a good programming practice.
  2. $ListPos +=1 should be $ListPos++. Its much more readable this way - the ++ operator is there for a reason, you know :)
  3. In your file paths, just use a single forward slash - perl will translate the slashes to the correct type based on the system.
  4. This block:
    if ($TheLine =~ /<RD>[^\n]*Status Compendium<<.JL>/i) { $ListPos = 0; until($ListPos > $#WordList) { if ($TheLine eq $WordList[$ListPos]) { $TheLine = ""; pop(@WordList) } $ListPos +=1 } } print OUTPUT "$TheLine";
    can be reduced to:
    if ($TheLine =~ /<RD>[^\n]*Status Compendium<<.JL>/i) { for(my $i=0; $i > @WordList; $i++) { print OUTPUT $TheLine if ($TheLine ne $WordList[$i]) } }

    This is much more easy to read and efficient, since you arent using @WordList after you are done with the program. Give it a whirl.
  5. Instead of explictly timing your program, consider using Benchmark. It is much more accurate

Sorry for being nitpicky, but I felt the urge :) Good Luck!


In reply to Re: Remove a line of text by jryan
in thread Remove a line of text by Larry

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.