in reply to case-insensitive hash keys
The simplest way is to just force every use to lower-case:
my %assoc = (); $assoc{lc('TheKey')} = 'test'; print $assoc{lc('TheKEY')}, $/;
(Added) Take a look at Hash::Case. It has Hash::Case::Lower, which uses a tied hash to enforce lower case keys. Sounds like just what you want.
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: case-insensitive hash keys
by ManFromNeptune (Scribe) on Aug 21, 2004 at 00:17 UTC | |
by Limbic~Region (Chancellor) on Aug 21, 2004 at 00:45 UTC | |
by ManFromNeptune (Scribe) on Aug 22, 2004 at 03:12 UTC | |
by Aristotle (Chancellor) on Aug 22, 2004 at 09:35 UTC | |
by Limbic~Region (Chancellor) on Aug 22, 2004 at 05:05 UTC | |
by cyocum (Curate) on Aug 21, 2004 at 00:27 UTC |