in reply to Re: Config::General to read both scalars and arrays
in thread Config::General to read both scalars and arrays

I didn't know we have state variables now. I've been away reeeally long =)
use Text::CSV; use feature 'state'; sub split_array_str ($value) { state $csv = Text::CSV->new ({ sep_char => ",", quote_char => '"', + allow_whitespace => 1 }); return $csv->parse( substr($value,1,-1) ) ? [$csv->fields] : $value; }


holli

You can lead your users to water, but alas, you cannot drown them.