/usr/share/perl5/Readonly/Scalar.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 | package Readonly::Scalar;
our $VERSION = '1.04';
sub TIESCALAR {
my $whence
= (caller 2)[3]; # Check if naughty user is trying to tie directly.
Readonly::croak "Invalid tie"
unless $whence && $whence =~ /^Readonly::(?:Scalar1?|Readonly)$/;
my $class = shift;
Readonly::croak "No value specified for readonly scalar" unless @_;
Readonly::croak "Too many values specified for readonly scalar"
unless @_ == 1;
my $value = shift;
return bless \$value, $class;
}
sub FETCH {
my $self = shift;
return $$self;
}
*STORE = *UNTIE = sub { Readonly::croak $Readonly::MODIFY};
|