YAML::PP::Writer::File - Write YAML output to file or file handle
my $writer = YAML::PP::Writer::File->new(output => $file);
The YAML::PP::Emitter sends its output to the writer.
You can use your own writer. if you want to send the YAML output to somewhere else. See t/44.writer.t for an example.
my $writer = YAML::PP::Writer::File->new(output => $file); my $writer = YAML::PP::Writer::File->new(output => $filehandle);
Constructor.
$writer->write('- ');
$writer->init;
Initialize
$writer->finish;
Gets called when the output ends. If The argument was a filename, the filehandle will be closed. If the argument was a filehandle, the caller needs to close it.
Getter/setter for the YAML output
To install YAML::PP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm YAML::PP
CPAN shell
perl -MCPAN -e shell install YAML::PP
For more information on module installation, please visit the detailed CPAN module installation guide.