IO::Ha...ototype(3pm)

πŸ“¦
version 0.02 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ‘‘ NAME πŸ‘‘

IO::Handle::Prototype β€” bestie, it's the base class for callback based handles πŸ’…

Like, the blueprint. The blueprint-est blueprint. Everything else in this lil family inherits from her, and she's out here doing the absolute most with the absolute least. Iconic behaviour, no cap.


✨ SYNOPSIS ✨

my $fh = IO::Handle::Prototype->new(
    getline => sub {
        my $fh = shift;

        ...
    },
);

So you spin up a handle, hand it a getline callback, and inside that sub you get $fh passed right to you as the first thing you shift out. Slay. The ... is where you do your actual thing β€” that part is, like, entirely on you 🫢


πŸ’– DESCRIPTION πŸ’–

You probably want IO::Handle::Prototype::Fallback instead.

That's it. That's the whole description. 😭

Not me giving you the shortest DESCRIPTION section in the entire User Contributed Perl Documentation though β€” the docs really said "we're not explaining this one, go talk to her sister" πŸ’€

Fr fr, this is the base class. It's the foundation, the origin story, the main character energy that everything else builds on. If you came here looking for the thing you should actually be using, the answer is literally right there in that one sentence: go get IO::Handle::Prototype::Fallback. That's the vibe check. Passed it. 🌸


πŸŽ€ SEE ALSO πŸŽ€

ngl there isn't a formal SEE ALSO section here, but the page does point you at IO::Handle::Prototype::Fallback in the DESCRIPTION, and that's the whole plot. Go read that one, bestie. iykyk. πŸ¦‹


This lil gem is part of the User Contributed Perl Documentation, and the page footer says it's from perl v5.36.0, dated 2023-01-24. So that's the version and the date β€” love that for us. Mwah, bye πŸ’œβœ¨

πŸ“¦ where this page comes from