Clownf...harBuf(3pm)

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

πŸ’– Clownfish::CharBuf πŸ’–

ok so bestie, welcome to Clownfish::CharBuf β€” it's a growable buffer that holds Unicode characters, and it lives over in the User Contributed Perl Documentation for section 3pm. she's a grower, not a shower, and honestly? iconic behavior. πŸŽ€


✨ SYNOPSIS ✨

like, here's the whole vibe in five lines:

my $buf = Clownfish::CharBuf->new;
$buf->cat('abc');
$buf->cat_char(ord("\n"));
print $buf->to_string;

see how she just… accumulates? no cap. πŸ’…


🌸 DESCRIPTION 🌸

ok this part of the page is literally empty in the original, so we're just gonna vibe here together. no extra lore. don't come for me. πŸ’€


πŸŽ€ CONSTRUCTORS πŸŽ€

πŸ’« new

my $char_buf = Clownfish::CharBuf->new(
    capacity => $capacity,  # default: 0
);

returns you a brand-new CharBuf, fresh out the box, main character energy from day one. ✨

  • capacity β€” the initial minimum capacity of the CharBuf, measured in bytes. default is 0, so she starts small and grows into herself. πŸ¦‹

πŸ”₯ METHODS πŸ”₯

πŸ’œ cat

$char_buf->cat($string);

glues the contents of the String string onto the end of the caller. like adding to the group chat, but for characters.

  • string β€” the String you wanna concatenate. 🫢

🌈 cat_char

$char_buf->cat_char($code_point);

adds exactly one Unicode character onto the end of the CharBuf. just one. a single little guy.

  • code_point β€” the code point of that Unicode character. πŸ‘‘

⭐ grow

$char_buf->grow($capacity);

hands the CharBuf more memory, but only if she doesn't already have enough room for a string of size bytes. heads up bestie: this cannot shrink the allocation β€” she only goes up, never down. πŸ“ˆ

  • capacity β€” the new minimum capacity of the ByteBuf.

🧚 clear

$char_buf->clear();

wipes the CharBuf clean. factory reset but make it cute. 🫧

πŸ’… get_size

my $int = $char_buf->get_size();

tells you the size of the CharBuf's content, in bytes. yes, bytes, not vibes. 😭

🌸 clone

my $result = $char_buf->clone();

returns a clone of the object. a whole twin. spooky season but useful. πŸͺž

πŸ¦‹ yield_string

my $string = $char_buf->yield_string();

returns the content of the CharBuf as a String and clears the CharBuf in one move. she gives you everything and then walks away. this is more efficient than to_string(), so, like, use it. πŸ”₯


πŸ‘‘ INHERITANCE πŸ‘‘

Clownfish::CharBuf isa Clownfish::Obj. family tree confirmed. 🌳


reminder bestie: every flag, default and detail above is straight from the source β€” i did not make anything up, and you should not either. πŸ’–

mwah, that's the whole page! this one shipped with perl v5.42.3 and is dated 2026-09-02 β€” go forth and concatenate, you absolute legend. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from