Data::Sofu::Undefined - A Sofu non type
Provides a interface similar to the original SofuD (sofu.sf.net)
This Object is similar to Perl's undef .
It is nothing (not even a Data::Sofu::Value) but it is still there (in Lists or Maps for example)
Data::Sofu::Value
require Data::Sofu::Undefined; require Data::Sofu::Map; my $u = Data::Sofu::Undefined->new(); my $map = Data::Sofu::Map->new(); $map->setAttribute("Nx",$u); $map->hasMap("Nx"); # Returns 0 $map->hasValue("Nx"); # Returns 0 $map->hasAttribute("Nx"); # Returns 1 # It is also there in $map->each() and $map->next();
This Module is pure OO, exports nothing
Also look at Data::Sofu::Object for methods, cause Undefined inherits from it
Data::Sofu::Object
Creates a new Data::Sofu::Undefined and returns it
Data::Sofu::Undefined
$val = Data::Sofu::Undefined->new();
Returns false
Returns the string representation of this Object.
Which is the string "UNDEF"
LEVEL and TREE are ignored.
Returns a binary representation of this Object. Don't call this (will be called from packBinary() and writeBinary())
This still tests true when using:
my $u=Data::Sofu::Undefined->new(); if ($u) { #This will happen. } if ($u->isDefined()) { #This will not happen. }
Data::Sofu, Data::Sofu::Value, Data::Sofu::Object, Data::Sofu::Map, Data::Sofu::Value, Data::Sofu::Reference, 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.