Clownfish::Hash(3pm)

πŸ“¦
version 0.8.0 Β· 3 versions
, in fedora 43, fedora 44

πŸ’– 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