I may now have more information about the problem I experienced a couple years ago. I now think that the problem I ran into was running out of memory under Cygwin (not positive) when processing a large number of files. I just ran a test under Linux to try to recreate the problem and ran out of memory when the code snippet below was inside a subroutine. if I moved the "my" line outside the subroutine there was no memory issue. Windows does not appear to have the same problem (memory usage remains steady). but it also looks like The Text::CSV code may be handling the split of the data I am using quite right - it looks like it has trouble with the combination of quoted fields and escape characters and probably escaped " characters in particular (not sure - still testing). but my main goal here is to alert people of the possible memory leak issue - Cygwin (32 bit) and Linux (32 bit) may have a problem and there may be others. I have reported a bug on CPAN.

my $CSV = Text::CSV_XS->new ({binary => 1, escape_char => "\\"}); + # need binary and change escape character if ($CSV->parse($line_to_split))

In reply to Re^2: CSV SPLIT by Anonymous Monk
in thread CSV SPLIT by serene_monk

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.