SPVM::Data::Package - SPVM object
SPVM::Data::Package is wrapper of SPVM object.
You can call all methods of SPVM object.
An example:
# lib/Point.spvm package Point { haz x : int; haz y : int; sub new : Point ($x : int, $y : int) { my $self = new Point; $self->{x} = $x; $self->{y} = $y; return $self; } sub clear : void ($self : self) { $self->{x} = 0; $self->{y} = 0; } sub set_x : void ($self : self, $value : int) { $self->{x} = $value; } sub x ($self : self) { return $self->{x}; } } # main.pl use FindBin; use lib "$FindBin::lib"; use SPVM 'Point'; my $point = Point->new; $point->set_x(4); my $x = $point->x; $point->clear;
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.