Re: CVS_XS Module



Tnx,
i'll better know how to read the manual next time.
BTW print to $fd raised 2 errors(i did it before i asked..)


cya


Xavier Noria כתב:
> On Jan 28, 2006, at 9:06, itzik brown wrote:
>
> > #!/usr/bin/perl -w
> > use strict;
> > use Text::CSV_XS;
> > use IO::File;
> >
> > my $csv = Text::CSV_XS->new();
> > my $fd = new IO::File;
> > open $fd,">","out.csv" or die "can't open file for writing\n";
> >
> > my @cols = ('cow','dog','bar');
> > $csv->print($fd,\@cols);
> > @cols = ('1','2','bar');
> > $csv->print($fd,\@cols);
> >
> > close $fd;
> >
> > My Question:
> > How Do i put new lines between the lines in the csv files?
>
> Reading both the docs (which are not very clear in this regard) and
> the source code, the solution within the module API is:
>
> my $csv = Text::CSV_XS->new({ eol => "\n" });
>
> -- fxn

.



Relevant Pages

  • CVS_XS Module
    ... use strict; ... How Do i put new lines between the lines in the csv files? ... Prev by Date: ...
    (perl.beginners)
  • Re: Check POP3 E-mail
    ... >> TNX ... > use strict; ... > use warnings; ... Oops, you did it again! ...
    (comp.lang.perl.misc)
  • Re: How to call the remains of a pattern match
    ... Tnx ... use strict; ... You could use $' (look for POSTMATCH in man perlre, but this imposes a performance penalty). ... Mark ...
    (comp.lang.perl.misc)
  • Re: Check POP3 E-mail
    ... Tihana wrote: ... > TNX ... use strict; ... use warnings; ...
    (comp.lang.perl.misc)
  • Re: why is important to use : use strict?
    ... > Perl script work very good without this command. ... > Tnx. ... It really helps with typos, ... unnoticed without strict. ...
    (comp.lang.perl.misc)