From jklein at triton.net Tue Apr 2 13:40:48 2002 From: jklein at triton.net (Jeff Klein) Date: Wed Aug 4 00:01:20 2004 Subject: Hash Buckets trivia Message-ID: <000e01c1da7e$4a4bca60$eea741d8@oemcomputer> A follow-up to the trivia question at the last meeting -- a hash in a scalar context returns the number of hash buckets used and the number allocated. === for $i (1..1000) { $h{$i} = 1; } print scalar(%h), "\n"; print scalar(keys %h), "\n"; === 541/1024 1000 === Note that neither of these is the number of entries in the hash, exactly why is a matter of Perl's internal implementation. -Jeff