/usr/share/perl5/Mango/BSON/Binary.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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | package Mango::BSON::Binary;
use Mojo::Base -base;
use overload bool => sub {1}, '""' => sub { shift->data }, fallback => 1;
use Mojo::Util 'b64_encode';
has [qw(data type)];
sub TO_JSON { b64_encode shift->data, '' }
1;
=encoding utf8
=head1 NAME
Mango::BSON::Binary - Binary type
=head1 SYNOPSIS
use Mango::BSON::Binary;
my $bin = Mango::BSON::Binary->new(data => $bytes, type => 'generic');
say $bin->data;
=head1 DESCRIPTION
L<Mango::BSON::Binary> is a container for the BSON binary type used by
L<Mango::BSON>. For C<JSON> implementations like L<Mojo::JSON>, that support
the C<TO_JSON> method, it will automatically C<Base64> encode the binary data.
=head1 ATTRIBUTES
L<Mango::BSON::Binary> implements the following attributes.
=head2 data
my $bytes = $bin->data;
$bin = $bin->data($bytes);
Binary data.
=head2 type
my $type = $bin->type;
$bin = $bin->type('generic');
Binary subtype.
=head1 METHODS
L<Mango::BSON::Binary> inherits all methods from L<Mojo::Base> and implements
the following new ones.
=head2 TO_JSON
my $b64 = $bin->TO_JSON;
Base64 encode L</"data">.
=head1 OPERATORS
L<Mango::BSON::Binary> overloads the following operators.
=head2 bool
my $bool = !!$bin;
Always true.
=head2 stringify
my $str = "$bin";
Alias for L</data>.
=head1 SEE ALSO
L<Mango>, L<Mojolicious::Guides>, L<http://mojolicio.us>.
=cut
|