in reply to Printing to file from Text::CSV_XS

If you specify an appropriate eol value in the constructor it should use that. eg. for Unix style line endings:

my $csv = Text::CSV_XS->new({ sep_char => "\t", eol => "\n" });

Update: The documentation is actually very clear on this:

When not passed in a generating instance, records are not terminated at all, so it is probably wise to pass something you expect. A safe choice for eol on output is either $/ or \r\n

Replies are listed 'Best First'.
Re^2: Printing to file from Text::CSV_XS
by dorko (Prior) on Jan 28, 2016 at 19:46 UTC
Re^2: Printing to file from Text::CSV_XS
by edimusrex (Monk) on Jan 28, 2016 at 17:03 UTC

    That did work for the line issue yet it is still wrapping the entire line in quotes

      Your subroutine cleanthis joins all the fields into one. Return a list instead and let Text::CSV_XS handle the joining.

      ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

        ah, I knew it was probably something simple. Thank you

        Changing return join("\t",@formatted) to simply return (@formatted) did the trick

      That's because your pre-processing is only passing a single field to the print method. If you don't want the quotes, don't use them. See quote_char.

      I do encourage you to read the documentation. It's very comprehensive.