SPVM::Stringer - Stringer in SPVM | a callback interface to stringify a object
use Stringer; my $stringer : Stringer = method : string ($object : object) { my $point = (Point)$object; my $x = $point->x; my $y = $point->y; my $string = "($x, $y)"; return $string; }; my $point = Point->new(1, 2); my $string = $stringer->($point);
Stringer is a callback interface to stringify a object.
method : string ($object : object)
This method receives a object and return the string expression.
This method is planned to be implemented in other classes.
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.