Test2::Harness::Util::File::Value - Utility class for a file that contains exactly 1 value.
This is a subclass of Test2::Harness::Util::File for files expected to have exactly 1 value stored in them.
use Test2::Harness::Util::File::Value; my $vf = Test2::Harness::Util::File::Value->new(name => 'path/to/file'); my $val = $vf->read;
Read all contents from the file, chomp() it, and return it.
chomp()
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.
The source code repository for Test2-Harness can be found at http://github.com/Test-More/Test2-Harness/.
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/
To install Test2::Harness, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test2::Harness
CPAN shell
perl -MCPAN -e shell install Test2::Harness
For more information on module installation, please visit the detailed CPAN module installation guide.