use strict;\r
use warnings;\r
\r
+our $MAP_SECTION_SPACE_TO_NESTED_KEY = 1;\r
+\r
=head1 NAME\r
\r
Config::Any::INI - Load INI config files\r
$out->{$_} = $main->{$_} for keys %$main;\r
\r
for my $k (keys %$config) {\r
- my @keys = split /\s+/, $k;\r
+ my @keys = split /\s+/, $k if $MAP_SECTION_SPACE_TO_NESTED_KEY;\r
my $ref = $config->{$k};\r
\r
if (@keys > 1) {\r
return $out;\r
}\r
\r
+=head1 PACKAGE VARIABLES\r
+\r
+=over 4\r
+\r
+=item $MAP_SECTION_SPACE_TO_NESTED_KEY (boolean)\r
+\r
+This variable controls whether spaces in INI section headings will be expanded into nested hash keys.\r
+e.g. it controls whether [Full Power] maps to $config->{'Full Power'} or $config->{'Full'}->{'Power'}\r
+\r
+By default it is set to 1 (i.e. true). \r
+\r
+Set it to 0 to preserve literal spaces in section headings:\r
+\r
+ use Config::Any;\r
+ use Config::Any::INI;\r
+ $Config::Any::INI::MAP_SECTION_SPACE_TO_NESTED_KEY = 0;\r
+\r
+=back\r
+\r
=head1 AUTHOR\r
\r
=over 4 \r
\r
=head1 COPYRIGHT AND LICENSE\r
\r
-Copyright 2006 by Brian Cassidy\r
+Copyright 2006 by Brian Cassidy, portions copyright 2006, 2007 by Joel Bernstein\r
\r
This library is free software; you can redistribute it and/or modify\r
it under the same terms as Perl itself. \r