RE: CSV problem on Solaris
am 28.06.2006 16:22:29 von Philip.Garrett-----Original Message-----
From: Govinda.Pfister@telekom.de [mailto:Govinda.Pfister@telekom.de]=20
Sent: Wednesday, June 28, 2006 9:47 AM
To: Garrett, Philip (MAN-Corporate)
Subject: AW: CSV problem on Solaris
> > > =20
> > > I do have a problem with a littler perl script I wrote. It uses
> > > DBD:CSV and I don=B4t know why it doesn=B4t work as I would expect =
it.
> > >
> > [snip]
> > >
> > > my $dbh =3D DBI->connect("DBI:CSV:");
> >=20
> > Add this after connecting:
> > $dbh->{RaiseError} =3D 1;
> >=20
> > This will cause DBI to die with an error message when there is a
> > problem.
>=20
> Just inserted. Fired the script again.
> The result is the same.
That probably means that you do indeed have a line-ending problem. I
have tested this on Solaris and I have the same problem. The issue is
that the default line ending for DBD::CSV is CR/LF (DOS format), but
(apparently?) UltraEdit uses Unix line endings (LF).
There are a couple of solutions:
* Use unix2dos to convert the CSV file format, or
* Specify line ending in the DBI connect call:
my $dbh =3D DBI->connect("DBI:CSV:csv_eol=3D\012");
Philip