If you don't understand simple scalar variables then you need to start with reading Perl Babysteps 1: Your First Simple Script. You are no where near ready to be parsing and reformating files! When you have read that turtorial and some of the others in the Getting Started with Perl section of tutorials, come back and we will help further.

Not understanding fundamental stuff like scalar variables is a severe impediment to completing any Perl script! We can provide a solution script for your assignement, but that doesn't help you at all. What is incredible though is that you have been given such an assignment when you seem to be so ill equiped to complete it. Is this because the course is poorly structured, or is your teacher right out of touch with what is actually going on in class?


DWIM is Perl's answer to Gödel

In reply to Re^3: Formatting Text...Again by GrandFather
in thread Formatting Text...Again by lollipop7081

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.