sub hash { my $string = shift; my $buckets = 100; my $hash_value = 0; foreach my $ordinal (map {ord} split(//, $string)) { $hash_value = ($hash_value + $ordinal) % $buckets; } return $hash_value; }