/usr/share/perl5/Log/Any/Adapter/Util.pm is in liblog-any-adapter-perl 0.11-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 47 48 49 50 51 52 53 54 55 56 57 58 59 | package Log::Any::Adapter::Util;
{
$Log::Any::Adapter::Util::VERSION = '0.11';
}
use Data::Dumper;
use strict;
use warnings;
use base qw(Exporter);
our @EXPORT_OK = qw(
cmp_deeply
dump_one_line
make_method
read_file
require_dynamic
);
sub cmp_deeply {
my ( $ref1, $ref2, $name ) = @_;
my $tb = Test::Builder->new();
$tb->is_eq( dump_one_line($ref1), dump_one_line($ref2), $name );
}
sub dump_one_line {
my ($value) = @_;
return Data::Dumper->new( [$value] )->Indent(0)->Sortkeys(1)->Quotekeys(0)
->Terse(1)->Dump();
}
sub make_method {
my ( $method, $code, $pkg ) = @_;
$pkg ||= caller();
no strict 'refs';
*{ $pkg . "::$method" } = $code;
}
sub read_file {
my ($file) = @_;
local $/ = undef;
open( my $fh, '<', $file )
or die "cannot open '$file': $!";
my $contents = <$fh>;
return $contents;
}
sub require_dynamic {
my ($class) = @_;
unless ( defined( eval "require $class" ) )
{ ## no critic (ProhibitStringyEval)
die $@;
}
}
1;
|