Language-MPI
view release on metacpan or search on metacpan
which nodes 'neighboring' the current node are of interest. returns
list of noderefs;
mpi_prop($thisnode, $propname, $obj)
$propname is the string name of a property. returns propval;
mpi_props($thisnode, $proppat, $obj)
$propat is a string specifier to a property directory or a subset of
properties. returns list of propnames;
mpi_propset($thisnode, $propname, $val, $obj)
INSTALATION
perl Makefile.PL
make
make install
Or simply copy the MPI.pm file to Language/ under the perl modules
directory. README and the man file for this package exist as pod data in
MPI.pm.
lib/Language/MPI.pm view on Meta::CPAN
$propname is the string name of a property.
returns propval;
=item mpi_props($thisnode, $proppat, $obj)
$propat is a string specifier to a property directory or a
subset of properties.
returns list of propnames;
=item mpi_propset($thisnode, $propname, $val, $obj)
=back
=head1 INSTALATION
perl Makefile.PL
make
make install
Or simply copy the MPI.pm file to Language/ under the perl
lib/Language/MPI.pm view on Meta::CPAN
}
=head2 {delprop:var[,obj]}
=cut
sub func_delprop
{ my ($this, $val) = @_;
my ($prop, $obj) = @$val;
$obj = $obj || $this->{'_node'};
if (defined &mpi_propset)
{ eval (&mpi_propset($obj, $prop, "", $this)); }
}
=head2 {dice:range[,count[,bonus]]}
=cut
sub func_dice
{ my ($this, $val) = @_;
my ($range, $count, $bonus) = @$val;
my ($indx, $tot);
lib/Language/MPI.pm view on Meta::CPAN
{ }
=head2 {store:val,property[,node]}
=cut
sub func_store
{ my ($this, $val) = @_;
my ($str, $prop, $obj) = @$val;
$obj = $obj || $this->{'_node'};
eval {&mpi_propset($obj, $prop, $str, $this)} || "";
}
=head2 {strip:string}
=cut
sub func_strip
{ my ($this, $val) = @_;
chomp $val->[0];
$val->[0] =~ s/^\s*//;
lib/Language/MPI.pm view on Meta::CPAN
sub mpi_prop
{ my ($thisnode, $propname) = @_;
"$thisnode/$propname";
}
sub mpi_props
{ my ($thisnode, $proppat) = @_;
("propa", "propb", "propc");
}
sub mpi_propset
{ my ($thisnode, $propname, $val) = @_;
"$thisnode,$propname,$val";
}
package main;
$mpi = new Language::MPI('dummy node');
@tests =
( 'plain text, no MPI',
sub mpi_prop
{ my ($thisnode, $propname) = @_;
"$thisnode/$propname";
}
sub mpi_props
{ my ($thisnode, $proppat) = @_;
("propa", "propb", "propc");
}
sub mpi_propset
{ my ($thisnode, $propname, $val) = @_;
"$thisnode,$propname,$val";
}
package main;
$mpi = new Language::MPI('dummy node');
@tests =
( 'plain text, no MPI',
( run in 0.913 second using v1.01-cache-2.11-cpan-71847e10f99 )