in reply to Re^2: Using Config::IniFiles Module Obtain Comma Separated Values into An Array
in thread Using Config::IniFiles Module Obtain Comma Separated Values into An Array
Config::IniFiles, as many other modules, is meant as a versatile instrument and therefore allows spaces, commas, etc. as part of the configuration values. So you seem to be out of luck.
A multi-line/value field that is returned in a scalar context will be joined using $/ (input record separator, default is \n) if defined, otherwise the values will be joined using \n.So you'd have to decide beforehand which separator to use - EITHER space OR comma OR dot (OR whatever) - and go for something like
$/ is a Perl builtin, see perlvar (search for $RS), so it's not a "third party method".my @arr; { local $/ = ' '; @arr=$cfg->val('hello','j'); }
OR make the multiline field in the ini file conform to the format specified in the "FILE FORMAT" section of the module's documentation…
|
|---|