logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Test2::Harness::Util::File::Value - Utility class for a file that contains exactly 1 value.

Authors

       Chad Granum <exodist@cpan.org>

Description

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

Maintainers

       Chad Granum <exodist@cpan.org>

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.

Name

       Test2::Harness::Util::File::Value - Utility class for a file that contains exactly 1 value.

Source

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

Synopsis

           use Test2::Harness::Util::File::Value;

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

See Also