projects
/
gitmo/Class-MOP.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
b07b8fdd62cb9fe9b13a5206e91fc1be0fe15c7e
[gitmo/Class-MOP.git]
/
bench
/
lib
/
MOP
/
Point.pm
1
2
package MOP::Point;
3
4
use strict;
5
use warnings;
6
use metaclass;
7
8
__PACKAGE__->meta->add_attribute('x' => (accessor => 'x', default => 10));
9
__PACKAGE__->meta->add_attribute('y' => (accessor => 'y'));
10
11
sub new {
12
my $class = shift;
13
$class->meta->new_object(@_);
14
}
15
16
sub clear {
17
my $self = shift;
18
$self->x(0);
19
$self->y(0);
20
}
21
22
1;
23
24
__END__