/usr/share/doc/libclass-insideout-perl/examples/Synopsis.pm is in libclass-insideout-perl 1.13-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 | package t::Object::Synopsis;
use strict;
use Class::InsideOut ':std'; # public, private, register and id
public name => my %name; # accessor: name()
private ssn => my %ssn; # no accessor
public age => my %age, {
set_hook => sub { /^\d+$/ or die "must be an integer" }
};
public initials => my %initials, {
set_hook => sub { $_ = uc $_ }
};
sub new {
register( bless \(my $s), shift );
}
sub greeting {
my $self = shift;
return "Hello, my name is $name{ id $self }";
}
1;
|