Skip Menu |

This queue is for tickets about the Config-General CPAN distribution.

Report information
The Basics
Id: 49042
Status: resolved
Priority: 0/
Queue: Config-General

People
Owner: Nobody in particular
Requestors: bemace [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.43
Fixed in: (no value)



Subject: DefaultConfig doesn't work without MergeDuplicateOptions
If you define a default value for a parameter via the DefaultConfig option and set the value in the config file, you get an array containing the default value followed by the config file value. I believe the correct behavior would be to only use the default values when the parameter is omitted from config file completely, regardless of MergeDuplicateOptions.
It behaves as expected. The DefaultConfig option will only be used to initialize the config hash. If a variable exists in the config, which were defined in the DefaultConfig, you as the programmer, have to decide how to behave. The standard IS to enable MergeDuplicateOptions. This way the pre-defined value will be overwritten. The parser doesn't know from where an eventually existing hash came. It could be that the existing data came from previous loops inside the parsed config file (eg. the user defined the same variables twice).