/usr/share/perl5/Mason/Plugin/LvalueAttributes/Interp.pm is in libmason-perl 2.24-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 | package Mason::Plugin::LvalueAttributes::Interp;
$Mason::Plugin::LvalueAttributes::Interp::VERSION = '2.24';
use Mason::PluginRole;
after 'modify_loaded_class' => sub {
my ( $self, $compc ) = @_;
$self->_add_lvalue_attribute_methods($compc);
};
sub _add_lvalue_attribute_methods {
my ( $self, $class ) = @_;
my @attrs = $class->meta->get_all_attributes();
foreach my $attr (@attrs) {
if ( $attr->_is_metadata eq 'rw' ) {
my $name = $attr->name;
$class->meta->add_method(
$name,
sub : lvalue {
if ( defined( $_[1] ) ) {
$_[0]->{$name} = $_[1];
}
$_[0]->{$name};
}
);
}
}
}
1;
|