in reply to how to read the line of each record??
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:
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";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 //. }
HTH
|
|---|