---
name: "Test2::Harness::Util::File::JSONL"
section: "3pm"
platform: "linux"
package: "libtest2-harness-perl"
version: "1.000158-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Test2::Harness::Util::File::JSONL"
---

# Test2::Harness::Util::File::JSONL(3pm)

Utility class for a JSONL file (stream)

## NAME

Test2::Harness::Util::File::JSONL - Utility class for a JSONL file (stream)

## DESCRIPTION

Subclass of Test2::Harness::Util::File and Test2::Harness::Util::File::Stream which automatically handles encoding/decoding JSONL data.

## SYNOPSIS

```
    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

```
    use Test2::Harness::Util::File::JSONL;
    my $jsonl = Test2::Harness::Util::File::JSONL->new(name => '/path/to/file.jsonl');
    $jsonl->write({my => 'item', ... });
    ...
```

## SEE ALSO

See the base classes Test2::Harness::Util::File and Test2::Harness::Util::File::Stream for methods.

## SOURCE

The source code repository for Test2-Harness can be found at *http://github.com/Test-More/Test2-Harness/*.

## 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/*
