/usr/share/perl5/Catmandu/Exporter/YAML.pm is in libcatmandu-perl 0.9206-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | package Catmandu::Exporter::YAML;
use namespace::clean;
use Catmandu::Sane;
use YAML::XS ();
use Moo;
with 'Catmandu::Exporter';
sub add {
my ($self, $data) = @_;
my $yaml = YAML::XS::Dump($data);
utf8::decode($yaml);
$self->fh->print($yaml);
}
=head1 NAME
Catmandu::Exporter::YAML - a YAML exporter
=head1 SYNOPSIS
use Catmandu::Exporter::YAML;
# Print to STDOUT
my $exporter = Catmandu::Exporter::YAML->new(fix => 'myfix.txt');
# Print to file or IO::Handle
my $exporter = Catmandu::Exporter::YAML->new(file => '/tmp/out.yml');
my $exporter = Catmandu::Exporter::YAML->new(file => $fh);
$exporter->add_many($arrayref);
$exporter->add_many($iterator);
$exporter->add_many(sub { });
$exporter->add($hashref);
printf "exported %d objects\n" , $exporter->count;
=head1 SEE ALSO
L<Catmandu::Exporter>
=cut
1;
|