Checkout the examples in
Perl Cookbook Recipe 1.15. One example
using
Text::ParseWords:
use Text::ParseWords;
sub parse_csv {
return quoteword(",",0, $_[0]);
}
The args are:
- "," the separator
- 0 the elements can be quoted
- $_[0] the string to process (the arg to the sub>
(Although I'd use single quotes around the comma as it is not likely to
contain a variable.)
traveler