[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-AnyPerl] About This .pm Stuff



On Sun, 2 May 1999 00:01:59 -0400, Richard Gordon wrote:

>3. Once the hash is tied and I do a search for a key, it works fine 
>unless the case of part of the search string doesn't match the case 
>of the key. This stuff was originally published for print, not web, 
>use and it's not unusual for case to be inconsistent. Is there a way 
>to control case sensitivity when searching keys in the same way that 
>you might with m//i?

No. Unless you would use something like 

	@keys = grep {  /^$word$/i } keys %hash;

but I expect this to be VERY slow.

My advice would be to make the keys lower case, when entering the data
in the hash.

	$hash{lc $keyword} = $value;

	Bart.

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-anyperl-request@macperl.org