_FDelimiter is the field delimiter between field names in the header row (if any) and also between fields in the body of the file. If undef, read() will try to guess whether it is tab "\t" or comma <",">, and set this parameter accordingly. If there is only one field in the file, then comma is assumed by read() and will be used by write().To guess the delimiter, the program looks for the first comma or tab character in the header row (if present) or in the first record. Whichever character is found first is assumed to be the delimiter.
If you don't want the program to guess, or you have a data file format that uses a custom delimiter, specify the delimiter explicitly in the object or when calling read() or make a subclass that initializes this value differently. On write(), this will default to comma if it is empty or undef.
Its use is therefore fairly limited if you venture outside of the world of the comma- or tab-separated type of files.
A somewhat more flexible module is Text::CSV::DetectSeparator which can distinguish between the following delimiters , ; . : # (it strangely omits the tab-delimiter).
Text::CSV::Separator is even more flexible. Its standard list of delimiters is , ; : | \t, but it accepts a list of other candidates and can even use an "excluded" list of characters.
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
In reply to Re^2: what type of deliminator is used in tabular file.
by CountZero
in thread what type of deliminator is used in tabular file.
by wst
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |