in reply to On creating hash whose keys aren't case-sensitive
I haven't personally used the module, but it might be an opportunity to try out Tie::Hash::Regex. Your content-length key could match against a regex like this, for example:
/^(?i:-?content[_-]length)$/
From looking over the synopsis, the lookup would be as follows:
$hash{'^(?i:-?content[_-]length)$'}
Realistically though, it's probably better to leave hash behavior alone, and just normalize your input before trying to do key lookups.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: On creating hash whose keys aren't case-sensitive
by anazawa (Scribe) on Feb 18, 2012 at 16:29 UTC |