Right, the default record separater is "\015\012", so you need to specifically set the eol to "\n" if the file uses a platform-specific eol.The default behavior (from the docs) looks carriage return, line feed. csv_csv The attributes csv_eol ... Defaults are "\015\012"
Would it be more portable if the default eol be based on the OS eol?Well, I thought so, and that's why AnyData works that way. But CSV worked with the "\015\012" default when I inherited it and there are too many scripts out there based on that behaviour for me to contemplate breaking backward compatibility. It is also useful in some situations (e.g. accessing a file created in windows from a linux samba share). The only thing I can think to do is improve the docs, but please let me know if you have other ideas that wouldn't break existing scripts.
# Works, except skips the first line (fields names)
Contents of myfile 1,Tom 2,Aaron 3,Ryan 4,Susan
Your file doesn't appear to have the column names in the first row which DBD::CSV expects by default. You need to either add the names to the data file, or tell the DBD the column names for the table like so:
$dbh->{csv_tables}->{myfile}->{col_names}=['id','name'];
Please let me know if you run into anything else, thanks much for gowing to the trouble.
-- Jeff