Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: More Sorted Business with Hashes

by mstone (Deacon)
on Dec 24, 2001 at 05:03 UTC ( [id://134129] : note . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $HASH_LIMIT = 1024;
    
    ...
    for $k (qw( testing the hash function )) {
        printf ("%10s - %s\n", $k, &myhash($k));
    }
    
  2. or download this
    @MY_HASH = (0) x $HASH_LIMIT;
    
    ...
    
        return ($MY_HASH[ &myhash($key) ]);
    }