Clownfish::Hash(3pm)
π Clownfish::Hash π
okay so bestie, welcome to Clownfish::Hash(3pm) β it's part of the User Contributed Perl Documentation, and it is literally just a hashtable. That's it. That's the whole vibe. β¨
πΈ NAME πΈ
Clownfish::Hash β a hashtable. yes queen, that's the name, that's the function, no notes. π
π¦ SYNOPSIS π¦
here's the whole thing in three little lines, look how cute it is:
my $hash = Clownfish::Hash->new;
$hash->store($key, $value);
my $value = $hash->fetch($key);
π DESCRIPTION π
so the way this works: values get stored by reference, and they can be any kind of Obj. Any. Kind. Go feral, bestie. π«Ά
β¨ CONSTRUCTORS β¨
π new
my $hash = Clownfish::Hash->new(
capacity => $capacity, # default: 0
);
Returns a brand new Hash. icon behavior fr fr. π
- capacity β the number of elements the hash is gonna be asked to hold at the start. (default is
0, so if you don't say anything, she starts empty and unbothered.)
π METHODS π
π§ clear
$hash->clear();
Empties the hash of all key-value pairs. every single one. gone. no crumbs. π
π store
$hash->store($key, $value);
Stores a key-value pair. that's it, that's the job. πΈ
β fetch
my $obj = $hash->fetch($key);
Fetches the value that's chillin' with key.
Returns: the value β or undef if key isn't present. so if you get undef back, don't panic, she just doesn't know that key. π
π₯ delete
my $obj = $hash->delete($key);
Attempts to delete a key-value pair from the hash. (note the word attempt, bestie β she might not find it.)
Returns: the value, if key exists and the deletion therefore succeeds; otherwise undef. π«Ά
π has_key
my $bool = $hash->has_key($key);
Tells you whether the key you handed over is present. yes/no, in or out, vibe check complete. β¨
π keys
my $arrayref = $hash->keys();
Returns the Hash's keys. an arrayref of them. all of them. π
πΈ values
my $arrayref = $hash->values();
Returns the Hash's values. an arrayref, same energy, different list. π
π get_size
my $int = $hash->get_size();
Returns the number of key-value pairs. the headcount. the census. the population. π₯
𧬠INHERITANCE π§¬
Clownfish::Hash isa Clownfish::Obj. she's got lineage, she's got main character energy, she inherited it. π
and that's the whole page bestie!! this one came from perl v5.42.3, dated 2026-09-02, and it's the Clownfish::Hash(3pm) page. mwah, go store something. πβ¨ππ¦
π¦ where this page comes from
- fedora 43: perl-Clownfish 0.8.0-1.fc43 Β· Apache-2.0
- fedora 44: perl-Clownfish 0.8.0-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms