Test2::Harness::Util::File::Value(3pm)

Test2::Harness::Util::File::Value3pm

Utility class for a file that contains exactly 1 value.

Usage

    use Test2::Harness::Util::File::Value;
    my $vf = Test2::Harness::Util::File::Value->new(name => 'path/to/file');
    my $val = $vf->read;

Overview

This is a subclass of Test2::Harness::Util::File for files expected to have exactly 1 value stored in them.

Methods

$val = $vf->read()

Read all contents from the file, chomp() it, and return it.

$val = $vf->read_line()

Read the first line from the file, chomp() it, and return it. Note, this may not return anything if the value in the file does not terminate with a newline.

Source

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

Maintainers

Chad Granum <[email protected]>

Releases

2 releases since Debian 12 (Bookworm); the text changed 1 time.

  1. 12
  2. 13

Authors

Chad Granum <[email protected]>

From libtest2-harness-perl 1.000158-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.