...and you can get a better start here if you'll read the docs; particularly, On asking for help and How do I post a question effectively?.
Despite Parson choroba's generous response, this is NOT code-a-matic. We try to help those like yourself -- "new to perl" -- by helping them learn; not by solving their problems. So next time you have a problem like this; try to organize your thoughts about how you'd do the job on paper, and then, using perldoc -f function and the fine Tutorials here, try to come up with code to solve your quandry.

If it works, you've really learned something; if it doesn't, and you can't figure out "why," then by all means, come back with the issue, your code (and data; each wrapped in <c>...</c> tags), an explanation of how your code fails to satisfy your intent, and verbatim quotes of any error messages or warnings.

P.S. use strict; use warnings; or a recent enough version of Perl that invoking the version (for example, use 5.014;) does so for you. Those pragmas alone will help you find many sneaky little mistakes (to say nothing of big ones.

PPS: If the solution choroba provided doesn't work for you, check that the quoting used is that required by your system -- windoze won't like what you've been given.


In reply to Re: changing the first number of every line by ww
in thread changing the first number of every line by jinism

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.