What happened with your first code sample? Did it also stop on the first line?

I see you are only using strict, not warnings. Diagnostics does not turn on warnings automatically. When you add use warnings, what do you see? Do you get any warnings? What diagnostics print out with them?

If you really have a problem with line endings it should be obvious in your loops. In the first bit of code, what happens if you include the line local $"='|'; print STDERR "<@$row>\n" at the top of the while loop in the first example? If you include print STDERR "<$line>\n"., what happens?

In the two print statements, you'll note that I sent output to STDERR. This is to make the debugging statements easier to find when you are ready to comment them out or delete them. I also surrounded the variable I wanted to print with "<...>" and changed the separator between array elements in a string to a pipe ('|'). This is done so that the presence of whitespace is more obvious.

Best, beth


In reply to Re: line ending problem Text::CSV alternative Text::ParseWords? by ELISHEVA
in thread line ending problem Text::CSV alternative Text::ParseWords? by GertMT

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.