/usr/share/perl5/Geometry/Primitive/Point.pm is in libgeometry-primitive-perl 0.22-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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | package Geometry::Primitive::Point;
use Moose;
use Moose::Util::TypeConstraints;
use MooseX::Storage;
with qw(Geometry::Primitive::Equal MooseX::Clone MooseX::Storage::Deferred);
use overload ('""' => 'to_string');
has 'x' => (
is => 'rw',
isa => 'Num'
);
has 'y' => (
is => 'rw',
isa => 'Num'
);
coerce 'Geometry::Primitive::Point'
=> from 'ArrayRef'
=> via { Geometry::Primitive::Point->new(x => $_->[0], y => $_->[1]) };
sub equal_to {
my ($self, $other) = @_;
return (($self->x == $other->x) && $self->y == $other->y);
}
sub to_string {
my ($self) = @_;
return $self->x.','.$self->y;
}
__PACKAGE__->meta->make_immutable;
no Moose;
1;
=head1 NAME
Geometry::Primitive::Point - An XY coordinate
=head1 DESCRIPTION
Geometry::Primitive::Point represents a location in two dimensional space.
=head1 SYNOPSIS
use Geometry::Primitive::Point;
my $point = Geometry::Primitive::Point->new({ x => 2, y => 0 });
=head1 ATTRIBUTES
=head2 x
Set/Get the X value.
=head2 y
Set/Get the Y value.
=head1 METHODS
=head2 new
Creates a new Geometry::Primitive::Point.
=head2 equal_to
Compares this point to another.
=head2 to_string
Return this point as a string $x,$y
=head1 AUTHOR
Cory Watson <gphat@cpan.org>
=head1 COPYRIGHT & LICENSE
You can redistribute and/or modify this code under the same terms as Perl
itself.
|