SPVM::Document::PerlAPI - SPVM Perl API
SPVM Perl API is the API to manipulate SPVM data from Perl script.
SPVM Data is Package Based Object and Array Object.
Create 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 byte array from not decoded Perl string. This function is faster than new_byte_array_string because the data is not encoded.
new_byte_array_string
my $array = SPVM::new_byte_array_data("AGTCAGTC");
Create byte array from decoded Perl string.
my $array = SPVM::new_byte_array_string("‚ ‚¢‚¤‚¦‚¨");
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 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');
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'SPVM::new_byte_array_string("‚ ‚¢‚¤‚¦‚¨");'. Assuming CP1252
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.