Hi,

Sorry for the late reply. Just logged in after work. This is awesome!!. Truly a genius solution!!. There's a lot I've learnt from your code.

Just so that I get it right, when you say next if !/^(\d+):(.*)/s; it means, just move next if you find a line that starts with one or more digits, followed by a colon, and then some stuff. I am not sure what the /s does though, does it mean "spill" this regex over even if there is a new line?

Further down, the next if !/^\s*?([^=]+)\s*=\s*(.*)/ I guess means

next if ! -> Move to the next line if the line does NOT / ^\s*? -> begin with one or more space (? makes this lazy I guess) ([^=]+)-> Does not include the literal "equal to" sign & create captur +e group of whatever text is there. \s* -> Some more space. = -> Literal "equal to" \s* -> Some more space. (.*) -> Second capture group of the remaining stuff. /

Please let me know if my understanding is right.

The lines  my ($id, $tail) = ($1, $2) and the entire code in the second while loop is simply amazing and an eye opener!! I have no words to express my gratitude for showing this amazing stuff!!


In reply to Re^4: Unable to get the paragraph in the list of hashes. Getting single lines instead. by pritesh_ugrankar
in thread Unable to get the paragraph in the list of hashes. Getting single lines instead. by pritesh_ugrankar

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.