/usr/share/perl5/App/Parcimonie/Role/HasEncoding.pm is in parcimonie 0.9-3.
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 | =head1 NAME
App::Parcimonie::Role::HasEncoding - role to provide an Encode::Encoding objet for the codeset being used
=head1 SYNOPSIS
use Moo;
with 'App::Parcimonie::Role::HasEncoding';
sub foo { $self->encoding->decode("bla") }
See App::Parcimonie::Daemon for a real-life usage example.
=cut
package App::Parcimonie::Role::HasEncoding;
use Encode qw{find_encoding};
use Moo::Role; # Moo::Role exports all methods declared after it's "use"'d
use MooX::late;
with 'App::Parcimonie::Role::HasCodeset';
use namespace::clean;
has 'encoding' => (
isa => 'Encode::Encoding|Encode::XS',
is => 'ro',
lazy_build => 1,
);
sub _build_encoding {
my $self = shift;
find_encoding($self->codeset);
}
no Moo::Role;
1; # End of App::Parcimonie::Role::HasEncoding
|