Skip Menu |

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

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

People
Owner: tlinden [...] cpan.org
Requestors: djerius [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 2.50
Fixed in: (no value)



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
Wow, cool idea! Sorry 4 the delay, I'll see how it can be done.
implemented in 2.51.