By "each line in the record", I presume you mean that a record -- that is, chunks separated by //\n -- should be further split where newlines \n occur (hint, hint). After you've read a chunk into $_, you should be able to get the "lines" with split:

while (<>){ # Read the each record and return one whole record $entry = SWISS::Entry->fromText($_); my @lines = split /\n/; # Now each element of @line is one "line" from the # block just read in. The last element is //. }
By the way, you don't need to escape the forward slashes when you assign a value to $/; that's a string, not a regexp, as explained in perlvar (the part that says awk has to better for something ;-). (In other words, you can just do $/ = "//\n";

HTH


In reply to Re: how to read the line of each record?? by VSarkiss
in thread how to read the line of each record?? by agustina_s

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.