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::File
  • Test2::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 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