'Tis a puzzlement... Okay, I've got this code:

my %h;

print scalar(%h), "\n";
$h{a} = 1;
print scalar(%h), "\n";
keys %h = 256;
print scalar(%h), "\n";
$h{$_}=$_ for 'a'..'zzz';
print scalar(%h), "\n";

and it prints out:

0
1/8
1/256
14056/32768

So what do those numbers mean? I thought I had it figured out until the last one. That would've made sense, too, if it'd been 18278, the number of strings between 'a' and 'zzz'. That would explain the 32768--the next 2**x after 18278. But where'd the 14056 come from?

Come to think of it, shouldn't the second line of output been 1/2? Or is eight the minimum number of buckets you get for a hash, whether you use 'em or not?

Thanks to anyone who feels like answering.

Deane
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to