Data::...neFlag(3pm)
π NAME π
okay so bestie, <pink>Data::Stream::Bulk::DoneFlag</pink> β this is the role that implements the is_done method in terms of a flag. that's the whole vibe. it lives in the perl man pages, the user contributed perl documentation section, and the page header calls it <cyan>Data::...neFlag(3pm)</cyan> because man page headers truncate like that, no cap π
β¨ VERSION β¨
version 0.11 β that's the one, that's the version, periodt π
π¦ SYNOPSIS π¦
okay here's the whole thing in action, look at her go:
package Data::Stream::Bulk::Blah;
use Moose;
with qw(Data::Stream::Bulk::DoneFlag);
sub get_more {
if ( my @more = more() ) {
return \@more;
} else {
return;
}
}
like. the with line pulls in the role, and then get_more does its little thing. iconic behaviour honestly πΈ
π DESCRIPTION π
so this role implements the <purple>Data::Stream::Bulk</purple> core API, and it does it in terms of exactly one method: get_more. one method!! main character energy fr fr π
and as a lil convenience (a treat, a gift, a lil snack π), it calls finished when the stream is exhausted, so your cleanup can actually happen. it's giving considerate. it's giving thoughtful. we love her.
classes like Data::Stream::Bulk::DBI and Data::Stream::Bulk::Callback use this. iykyk π
π METHODS π
is_doneβ returns the state of the iterator. that's it, that's the whole job. state check, slay β¨nextβ as long as the iterator is not yet done, this callsget_more. lowkey the whole engine of the thing.
and listen: if get_more returned a false value instead of an array reference, then done gets set, finished gets called, and this next does nothing on subsequent calls. nothing. nada. it's retired. it said "i'm done here" and meant it π
finishedβ a noop by default, bestie. it just sits there being nothing. but you can override it if you so desire, and honestly if you're doing cleanup you probably do desire π«Ά
π REQUIRED_METHODS π
get_moreβ returns the next block of data as an array ref, or a false value if there are no items left. that's the deal. that's the contract. array ref or false, no in-between π
π AUTHOR π
Yuval Kogman <nothingmuch@woobling.org> β the legend, the author, the one who did all this π
πΈ COPYRIGHT AND LICENSE πΈ
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.
and that's the whole page, bestie!! π§ it was documented as <purple>Data::...neFlag(3pm)</purple> by the user contributed perl documentation crew, running on perl v5.32.0, dated 2021-01-01. love that for us, mwah πβ
π¦ where this page comes from
- debian bookworm: libdata-stream-bulk-perl 0.11-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libdata-stream-bulk-perl 0.11-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libdata-stream-bulk-perl 0.11-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libdata-stream-bulk-perl 0.11-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms