/usr/share/doc/libmouse-perl/examples/traits.pl is in libmouse-perl 2.1.0-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 | #!/usr/bin/perl
package IntStack;
use Mouse;
has storage => (
is => 'ro',
isa => 'ArrayRef[Int]',
default => sub{ [] },
traits => [qw(Array)],
handles => {
push => 'push',
pop => 'pop',
top => [ get => -1 ],
},
);
__PACKAGE__->meta->make_immutable();
package main;
my $stack = IntStack->new;
$stack->push(42);
$stack->push(27);
print $stack->pop, "\n";
print $stack->top, "\n";
|