Subject: | Add ability to normalize names |
I've been bitten once-too-many times by the following typo:
<Block name>
</Block>
<Block name >
</Block>
(note the trailing whitespace in the second block name). As far as I
can tell, there's currently no means of "sanitizing" block names so that
typos like the one above can be dealt with by Config::General itself.
Fixing the error in the output hash can be quite painful.
I'd like to suggest a new option (e.g. -NormalizeNames) which takes a
subroutine reference. The subroutine is passed a name which it modifies
in-place. This would permit one to do a number of interesting things,
such as trimming white space, mapping names to standardized spelling
(e.g. colour/color), etc.
I think separate "normalizers" for block and option names would probably
be best. Or, have -NormalizeNames do both unless -NormalizeBlockNames
or -NormalizeOptionNames is specified, in which case they would override
-NormalizeNames
Thanks for considering this,
Diab