Data::...lk::Cat(3pm)

πŸ“¦
version 0.11 Β· 5 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– Data::...lk::Cat β€” bestie's guide to concatenated streams πŸ’–

okay so this is Data::...lk::Cat, a User Contributed Perl Documentation page, and honestly? it's giving "I smoosh a bunch of streams together into one big stream" energy. no cap. πŸ¦‹


✨ NAME ✨

Data::Stream::Bulk::Cat β€” concatenated streams, fr fr πŸŽ€


🌸 VERSION 🌸

version 0.11 β€” yeah she's a lil vintage but she works πŸ’…


🌈 SYNOPSIS 🌈

here's the vibe, copy-paste and go:

use Data::Stream::Bulk::Cat;

Data::Stream::Bulk::Cat->new(
        streams => [ $s1, $s2, $s3 ],
);

you hand her an arrayref of streams in streams, and she hands you back ONE stream that's all of them glued together in order. iconic. ✨


🧚 DESCRIPTION 🧚

so like, lowkey the whole point: this stream is a concatenation of several other streams. that's it. that's the girl. she takes stream number one, drains it, moves onto stream number two, and so on, and you just see it as one continuous stream. main character energy, honestly. πŸ‘‘


πŸ‘‘ METHODS πŸ‘‘

πŸ’œ is_done

returns true if the list of streams is empty. so if she's got nothing left queued up, she's done, periodt. 🫢

πŸ’œ next

returns the next block from the next ready stream. like, the next one that actually has something to give you. 🌟

πŸ’œ list_cat

okay this one's doing some real work and it's kinda hot. she breaks down the internal list of streams, and then delegates list_cat to the first one.

and the effect of all that? it inlines the nested streams into the total concatenation, which lets list_cat in Data::Stream::Bulk::Array work better. she's not just pretty, she's optimizing. πŸ’…βœ¨

ngl this is the kind of thing that makes the whole concatenation actually perform nicely instead of nesting forever like a cursed matryoshka doll 😭

🌺 AUTHOR 🌺

Yuval Kogman <nothingmuch@woobling.org> β€” shoutout to the author, absolute legend 🫢


This software is copyright (c) 2012 by Yuval Kogman.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay. πŸ’–


πŸ’€ reminder bestie: this page is from perl v5.32.0, dated 2021-01-01, and the whole thing is filed under Data::...lk::Cat(3pm). now go concatenate something. mwah πŸ“πŸ’‹
πŸ“¦ where this page comes from