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

[MacPerl] Tie::SubstrHash -- anybody??



I've gotten no response whatever to my questions about 
Tie::SubstrHash. The idea is that the module provides a more 
efficient (certainly in memory usage, maybe also in speed?) 
implementation of a hash with fixed-length keys and values. My own 
code demonstrated, though, that the MacPerl implementation of 
Tie::SubstrHash fails for very large hashes (in my example, 114,862 
k/v pairs).

Is there someone else I should contact about this error?

That fabulous sample code, one more time:
>#------------------------------
>#! /usr/local/bin/perl5
>
>require Tie::SubstrHash;
>
>print "Here we go!\n";
>$hashsize = 114_862;		# arbitrary values from my data set
>tie %test, "Tie::SubstrHash", 13, 86, $hashsize;
>
>for ($i = 1; $i <= $hashsize; $i++) {
>	$key1 = $i + 100_000;		# fix to uniform 6-digit numbers
>	$key2 = "abcdefg$key1";
>	$test{$key2} = ("abcdefgh" x 10) . "$key1";
>}
>
>print scalar(keys %test), "\n";
>
>print %test, "\n";
>print $test{"abcdefg207250"}, "\n";
>print (keys %test), "\n";
>print "\nDone.\n";
>#-----------------------------

This code prints a grand total of ONE KEY/VALUE PAIR for the entire 
hash. If you use the normal default hash structure, it works 
correctly.

-- 
Linc Madison  *  San Francisco, CA  *  LincPerl@LincMad.com
NO SPAM: California Bus & Prof Code Section 17538.45 applies!

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