add Bench::Run
[gitmo/Class-MOP.git] / bench / lib / Plain / Point.pm
CommitLineData
0f30f194 1#!/usr/bin/perl
2
5b1aeb78 3package Plain::Point;
0f30f194 4
5use strict;
6use warnings;
7
8sub new {
9 my ( $class, %params ) = @_;
10
11 return bless {
12 x => $params{x},
13 y => $params{y},
14 }, $class;
15}
16
17sub x {
18 my ( $self, @args ) = @_;
19
20 if ( @args ) {
21 $self->{x} = $args[0];
22 }
23
24 return $self->{x};
25}
26
27sub y {
28 my ( $self, @args ) = @_;
29
30 if ( @args ) {
31 $self->{y} = $args[0];
32 }
33
34 return $self->{y};
35}
36
37sub clear {
38 my $self = shift;
b07c7a9d 39 @{$self}{qw/x y/} = (0, 0);
0f30f194 40}
41
42__PACKAGE__;
43
44__END__
45