/usr/share/perl5/MLDBM/Serializer/Data/Dumper.pm is in libmldbm-perl 2.05-2.
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 60 61 62 63 64 65 | ####################################################################
package MLDBM::Serializer::Data::Dumper;
BEGIN { @MLDBM::Serializer::Data::Dumper::ISA = qw(MLDBM::Serializer) }
use Data::Dumper '2.08'; # Backward compatibility
use Carp;
#
# Create a Data::Dumper serializer object.
#
sub new {
my $self = shift->SUPER::new();
my $meth = shift || "";
$meth = (defined(&Data::Dumper::Dumpxs) ? 'Dumpxs' : 'Dump')
unless $meth =~ /^Dump(xs)?$/;
$self->DumpMeth($meth);
$self->RemoveTaint(shift);
$self->Key(shift);
$self;
}
#
# Serialize $val if it is a reference, or if it does begin with our magic
# key string, since then at retrieval time we expect a Data::Dumper string.
# Otherwise, return the scalar value.
#
sub serialize {
my $self = shift;
my ($val) = @_;
return undef unless defined $val;
return $val unless ref($val) or $val =~ m|^\Q$self->{'key'}|o;
my $dumpmeth = $self->{'dumpmeth'};
local $Data::Dumper::Indent = 0;
local $Data::Dumper::Purity = 1;
local $Data::Dumper::Terse = 1;
return $self->{'key'} . Data::Dumper->$dumpmeth([$val], ['M']);
}
#
# If the value is undefined or does not begin with our magic key string,
# return it as-is. Otherwise, we need to recover the underlying data structure.
#
sub deserialize {
my $self = shift;
my ($val) = @_;
return undef unless defined $val;
return $val unless $val =~ s|^\Q$self->{'key'}||o;
my $M = "";
($val) = $val =~ /^(.*)$/s if $self->{'removetaint'};
# Disambiguate hashref (perl may treat it as a block)
my $N = eval($val =~ /^\{/ ? '+'.$val : $val);
return $M ? $M : $N unless $@;
carp "MLDBM error: $@\twhile evaluating:\n $val";
}
sub DumpMeth { my $s = shift; $s->_attrib('dumpmeth', @_); }
sub RemoveTaint { my $s = shift; $s->_attrib('removetaint', @_); }
sub Key { my $s = shift; $s->_attrib('key', @_); }
# avoid used only once warnings
{
local $Data::Dumper::Terse;
}
1;
|