in reply to Hash Keys case independent

You can not do it with a simple hash. However, a tied hash may have whatever qualities you desire.

There are the following modules on CPAN that might be helpful:

Personally I would probably start with Tie::Hash, and create your own case-insensitive hash starting with that framework. tie and perltie will contain additional info on the details of tieing hashes.

Update: Fixed a few module names. Thanks Limbic~Region.


Dave

Replies are listed 'Best First'.
Re: Re: Hash Keys case independent
by Not_a_Number (Prior) on May 04, 2004 at 19:31 UTC
    You can not do it with a simple hash.

    Yes you can. However, that does not mean that you should :-)

    my %h = ( 'aDobe' => 'abcd', 'big boss' => 'gcd', 'ADOBe' => 'abcd2' ) +; my $str = 'AdOBE'; for ( keys %h ) { print "$h{$_}\n" if lc $_ eq lc $str; }