SPVM::Cloner - a callback type to clone a object
use SPVM::Cloner; my $cloner : SPVM::Cloner = sub : object ($self : self, $obj : object) { my $point = (SPVM::Point)$obj; my $new_point = SPVM::Point->new($point->x, $point->y); return $new_point; }; my $point = SPVM::Point->new(1, 2); my $point_clone = $cloner->($point);
SPVM::Cloner is a callback type to clone a object.
sub : object ($self : self, $obj : object);
This method should be cloned object in the method implementation.
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.