/usr/share/perl5/Mango/BSON/Document.pm is in libmango-perl 1.29-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 | package Mango::BSON::Document;
use Mojo::Base 'Tie::Hash';
sub DELETE {
my ($self, $key) = @_;
return undef unless exists $self->[0]{$key};
$key eq $self->[1][$_] and splice @{$self->[1]}, $_, 1 and last
for 0 .. $#{$self->[1]};
return delete $self->[0]{$key};
}
sub EXISTS { exists $_[0][0]{$_[1]} }
sub FETCH { $_[0][0]{$_[1]} }
sub FIRSTKEY {
$_[0][2] = 0;
&NEXTKEY;
}
sub NEXTKEY { $_[0][2] <= $#{$_[0][1]} ? $_[0][1][$_[0][2]++] : undef }
sub STORE {
my ($self, $key, $value) = @_;
push @{$self->[1]}, $key unless exists $self->[0]{$key};
$self->[0]{$key} = $value;
}
sub TIEHASH {
my $self = bless [{}, [], 0], shift;
$self->STORE(shift, shift) while @_;
return $self;
}
1;
=encoding utf8
=head1 NAME
Mango::BSON::Document - Document type
=head1 SYNOPSIS
use Mango::BSON::Document;
tie my %hash, 'Mango::BSON::Document';
=head1 DESCRIPTION
L<Mango::BSON::Document> is a container for the BSON document type used by
L<Mango::BSON>.
=head1 SEE ALSO
L<Mango>, L<Mojolicious::Guides>, L<http://mojolicio.us>.
=cut
|