/usr/share/perl5/Readonly/Array.pm is in libreadonly-perl 1.04-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 | package Readonly::Array;
our $VERSION = '1.04';
sub TIEARRAY {
my $whence
= (caller 1)[3]; # Check if naughty user is trying to tie directly.
Readonly::croak "Invalid tie" unless $whence =~ /^Readonly::Array1?$/;
my $class = shift;
my @self = @_;
return bless \@self, $class;
}
sub FETCH {
my $self = shift;
my $index = shift;
return $self->[$index];
}
sub FETCHSIZE {
my $self = shift;
return scalar @$self;
}
BEGIN {
eval q{
sub EXISTS {
my $self = shift;
my $index = shift;
return exists $self->[$index];
}
} if $] >= 5.006; # couldn't do "exists" on arrays before then
}
*STORE = *STORESIZE = *EXTEND = *PUSH = *POP = *UNSHIFT = *SHIFT = *SPLICE
= *CLEAR = *UNTIE = sub { Readonly::croak $Readonly::MODIFY};
|