Test2:...::JSONL(3pm)
π Test2::...::JSONL β bestie's guide to the JSONL file class π
okay so this is the manual page for Test2::Harness::Util::File::JSONL, and it ships as part of the User Contributed Perl Documentation, manual section 3pm. yes that's a long name. no we're not shortening it. it's iconic.
β¨ NAME β¨
Test2::Harness::Util::File::JSONL β it's a utility class for a JSONL file, aka a stream, and honestly? she's carrying the whole team.
π¦ DESCRIPTION π¦
So here's the tea: this class is a subclass of Test2::Harness::Util::File and Test2::Harness::Util::File::Stream β both of them, at the same time, it's giving overachiever β and what she does is handle encoding/decoding JSONL data for you. Automatically. No cap. You don't have to think about it, she just does it. π
πΈ SYNOPSIS πΈ
First way, the reading way, and yes there's a while (1) in there, we love a little eternal loop:
use Test2::Harness::Util::File::JSONL;
my $jsonl = Test2::Harness::Util::File::JSONL->new(name => '/path/to/file.jsonl');
while (1) {
my @items = $jsonl->poll(max => 1000) or last;
for my $item (@items) {
... handle $item ...
}
}
or, the other way, the writing way:
use Test2::Harness::Util::File::JSONL;
my $jsonl = Test2::Harness::Util::File::JSONL->new(name => '/path/to/file.jsonl');
$jsonl->write({my => 'item', ... });
...
that's it, that's the whole vibe. β¨
π SEE ALSO π
For all the actual methods β the how-do-I-call-this-stuff part β go look at the base classes:
Test2::Harness::Util::FileTest2::Harness::Util::File::Stream
they're right there, they have the methods, iykyk. π«Ά
π₯ SOURCE π₯
The source code repository for Test2-Harness lives at:
http://github.com/Test-More/Test2-Harness/
go be nosy, bestie, the code is right there. π
π MAINTAINERS π
- Chad Granum
<exodist@cpan.org>
π AUTHORS π
- Chad Granum
<exodist@cpan.org>
π COPYRIGHT π
Copyright 2020 Chad Granum <exodist7@gmail.com>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See:
http://dev.perl.org/licenses/
ngl, all of that legal stuff matters, so read it, don't skip it π«Ά
and that's the whole page, bestie. this one came to you from perl v5.40.1, dated 2026-05-10, under that Test2:...::JSONL(3pm) title β slay, go write some JSONL π
β¨πΈ
π¦ where this page comes from
- ubuntu stonking: libtest2-harness-perl 1.000172-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