Data::Sofu::Value - A Sofu Value
Provides a interface similar to the original SofuD (sofu.sf.net)
require Data::Sofu::Value; my $v = Data::Sofu::Value->new(); $v->set("Hello World");
This Module is pure OO, exports nothing
Also look at Data::Sofu::Object for methods, cause Value inherits from it
Data::Sofu::Object
Creates a new Data::Sofu::Value and returns it
Data::Sofu::Value
Converts DATA to a string if DATA is given.
$val = Data::Sofu::Value->new("Hello World");
Sets the contents of this Value (replaces the old contents).
Note: DATA will be converted to a string.
$v->set("Foobar");
Returns itself, used to make sure this Value is really a Value (Data::Sofu::Map and Data::Sofu::List will die if called with this method)
Perl only
Returns this Value as a perl Scalar (same as toString)
Returns this as a string
Not working in Perl (cause there is no wchar, char, dchar stuff going on, if you need to convert strings use "Encode")
They just return the same as toString()
Return the Value as an Integer
$v->toInt() === int $v->toString();
Return the Value as a Float
$v->toFloat() === $v->toString()+0;
Return the Value as a Long
$v->toLong() === int $v->toString();
Return the Value as a Double
$v->toDouble() === $v->toString()+0;
Returns 1
Returns a string representation of this Value.
LEVEL and TREE are ignored...
Returns the binary version of this Value using the BINARY DRIVER. Don't call this one, use binaryPack instead.
most of the methods do the same, because perl does the converting for you.
Data::Sofu, Data::Sofu::Binary, Data::Sofu::Object, Data::Sofu::Map, Data::Sofu::Value, Data::Sofu::Undefined, http://sofu.sf.net
To install Data::Sofu, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Sofu
CPAN shell
perl -MCPAN -e shell install Data::Sofu
For more information on module installation, please visit the detailed CPAN module installation guide.