DBD::CSV: How can I generate different behavior with the two f_ext-options ".csv" and ".csv/r"?

Posted by sid_com on Stack Overflow See other posts from Stack Overflow or by sid_com
Published on 2010-05-10T14:18:04Z Indexed on 2010/05/10 16:24 UTC
Read the original article Hit count: 761

Filed under:
|
|
|

This is from the DBD::File-documentation:

f_ext

This attribute is used for setting the file extension where (CSV) files are opened. There are several possibilities.

    DBI:CSV:f_dir=data;f_ext=.csv  

In this case, DBD::File will open only table.csv if both table.csv and table exist in the datadir. The table will still be named table. If your datadir has files with extensions, and you do not pass this attribute, your table is named table.csv, which is probably not what you wanted. The extension is always case-insensitive. The table names are not.

    DBI:CSV:f_dir=data;f_ext=.csv/r

In this case the extension is required, and all filenames that do not match are ignored.

It was not possible for me to generate different behavior with the two options ".csv/r" and ".csv". Could someone show me an example, where I can see the difference between ".csv/r" and ".csv"?

© Stack Overflow or respective owner

Related posts about perl

Related posts about dbi