Your code did incorporate the code from elTriberium (= vs =~).
However your code DOES NOT include the code from kennethk.
And it certainly does not show the combined effort of elTriberium, kennethk and Marshall.

Look at your code and then at what kennethk had to say. Maybe:

print $1 "\n"; # Your line versus [kennethk]'s line of print $1, "\n"; # might actually make a difference?
I think so!

When you say: I think you should have better tried those codes and then got in here., I think that you have made a mistake. My code combined two previous ideas and then added something more and it does run - no doubt about it. I was genuinely trying to help you.


In reply to Re^6: add new lines to output. by Marshall
in thread add new lines to output. by shaludr

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.