I know you mentioned in CB you were handed this task as part of your internship. If Perl is to be a significant portion of the internship, let me give you a suggestion that will go a lot farther than me showing you how to use the diamond operator, open, a while loop, and regular expressions.

Visit O'Reilly's website, and purchase Learning Perl (the ebook is only $15.99 nowadays). It will take you a few days to get to chapter five, where files are discussed. Chapters seven, eight, and nine discuss regular expressions. It will be time and cash well spent. In fact, you might even get your company to purchase it for you.

If you prefer to just read online materials, follow the links in the first paragraph of this post. They will take you to Perl's own free documentation on the topics you're investigating.

Other helpful documents from Perl's POD (Perl's free documentation): perlintro, perlopentut, and perlrequick. Whether it's by diving into Learning Perl, or into the POD, you've got a few days worth of work ahead of you. But then you will have acquired two useful skills, one of them being the fundamentals of programming with Perl.


Dave


In reply to Re^5: how to remove block of data from file based on string by davido
in thread how to remove block of data from file based on string by royalreddy

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.