SPVM::Point - Point
use Point; my $point = Point->new; my $point = Point->new_xy(1, 2); $point->set_x(1); $point->set_y(2); my $x = $point->x; my $y = $point->y; my $point_string = $point->to_string;
Point is a class for a point.
Point
Point class has the following interfaces.
Stringable
Cloneable
method new : Point ()
Create a new Point object.
method new_xy : Point ($x : int, $y : int)
Create a new Point object with x and y.
method x : int ()
Get x field.
x
void set_x : int ($x : int)
Set x field.
method y : int ();
Get y field.
y
void set_y : int ($y : int)
Set y field.
method to_string : string ();
Convert the Point object to a string as the following.
(1,2)
method cloneable_clone : object ()
Clone a Point object by create a new Point object and x and y fields are copied to the new object.
To install SPVM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SPVM
CPAN shell
perl -MCPAN -e shell install SPVM
For more information on module installation, please visit the detailed CPAN module installation guide.