SPVM::Document::PerlAPI - SPVM API(BETA)
Create new_byte array
my $array = SPVM::new_byte_array([1, 2, 3]);
If you get perl values, you can use get_elements methods.
get_elements
my $values = $array->get_elements;
Create short array
my $array = SPVM::new_short_array([1, 2, 3]);
Create int array
my $array = SPVM::new_int_array([1, 2, 3]);
Create long array
my $array = SPVM::new_long_array([1, 2, 3]);
Create float array
my $array = SPVM::new_float_array([1, 2, 3]);
Create double array
my $array = SPVM::new_double_array([1, 2, 3]);
Create object array with type name and length.
my $array = SPVM::new_object_array_len("int[]", 3);
You can set and get elements by set and get method.
set
get
$array->set(1, SPVM::new_int_array([1, 2, 3])); my $element = $array->get(1);
Create byte array from not decoded Perl string. This function is faster than SPVM::string because copy is not executed.
SPVM::string
my $array = SPVM::new_string_raw("AGTCAGTC");
Create byte array from decoded Perl string.
my $array = SPVM::new_string("□い▽え→");
Create object.
my $object = SPVM::new_object("Point");
You can set and get value by set and get method.
$object->set(x => 1); my $x = $object->get('x');
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.