projects
/
gitmo/moose-website.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
7b1617d0e39e54ef007c139673ab9a56543b83fe
[gitmo/moose-website.git]
/
data
/
code_samples
/
point.txt
1
package Point;
2
use Moose; # automatically turns on strict and warnings
3
4
has 'x' => (is => 'rw', isa => 'Int');
5
has 'y' => (is => 'rw', isa => 'Int');
6
7
sub clear {
8
my $self = shift;
9
$self->x(0);
10
$self->y(0);
11
}
12
13
package Point3D;
14
use Moose;
15
16
extends 'Point';
17
18
has 'z' => (is => 'rw', isa => 'Int');
19
20
after 'clear' => sub {
21
my $self = shift;
22
$self->z(0);
23
};