/usr/lib/perl5/Text/Bidi/Array/Byte.pm is in libtext-bidi-perl 2.08-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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | # Created: Tue 27 Aug 2013 06:09:42 PM IDT
# Last Changed: Fri 20 Sep 2013 08:57:53 AM IDT
use 5.10.0;
use warnings;
use integer;
use strict;
package Text::Bidi::Array::Byte;
{
$Text::Bidi::Array::Byte::VERSION = '2.08';
}
# ABSTRACT: Dual-life byte arrays
use Carp;
use Text::Bidi::Array;
use base qw(Text::Bidi::Array);
sub pack {
shift;
pack('C*', @_)
}
sub STORE {
my ( $self, $i, $v ) = @_;
vec($self->{'data'}, $i, 8) = $v
}
sub FETCH {
my ( $self, $i ) = @_;
vec($self->{'data'}, $i, 8)
}
sub FETCHSIZE {
length($_[0]->{'data'})
}
sub STORESIZE {
my ($self, $s) = @_;
if ($self->FETCHSIZE >= $s ) {
substr($self->{'data'}, $s) = '';
} else {
$self->STORE($s - 1, 0);
}
}
1;
__END__
=pod
=head1 NAME
Text::Bidi::Array::Byte - Dual-life byte arrays
=head1 VERSION
version 2.08
=head1 SYNOPSIS
use Text::Bidi::Array::Byte;
my $a = new Text::Bidi::Array::Byte "abc";
say $a->[1]; # says 98
say $$a; # says abc
say "$a"; # also says abc
=head1 DESCRIPTION
This is an derived class of L<Text::Bidi::Array> designed to hold C<byte>
arrays. See L<Text::Bidi::Array> for details on usage of this class. Each
element of the array representation corresponds to an octet in the string
representation, at the same location.
=head1 AUTHOR
Moshe Kamensky <kamensky@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Moshe Kamensky.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
|