Data::Object::Scalar
Data-Object Scalar Class
use Data::Object::Scalar; my $scalar = Data::Object::Scalar->new(\*main);
Data::Object::Scalar provides routines for operating on Perl 5 scalar objects. Scalar methods work on data that meets the criteria for being a scalar.
This package implements the following methods.
defined() : NumObject
The defined method returns true if the object represents a value that meets the criteria for being defined, otherwise it returns false. This method returns a Data::Object::Number object.
# given $scalar $scalar->defined; # 1
eq(Any $arg1) : NumObject
This method is a consumer requirement but has no function and is not implemented. This method will throw an exception if called.
# given $scalar $scalar->eq; # exception thrown
ge(Any $arg1) : NumObject
# given $scalar $scalar->ge; # exception thrown
gt(Any $arg1) : NumObject
# given $scalar $scalar->gt; # exception thrown
le(Any $arg1) : NumObject
# given $scalar $scalar->le; # exception thrown
lt(Any $arg1) : NumObject
# given $scalar $scalar->lt; # exception thrown
ne(Any $arg1) : NumObject
# given $scalar $scalar->ne; # exception thrown
roles() : ArrayRef
The roles method returns the list of roles attached to object. This method returns a Data::Object::Array object.
# given $scalar $scalar->roles;
rules() : ArrayRef
The rules method returns consumed rules.
my $rules = $scalar->rules;
This package inherits all behavior from the folowing role(s):
Data::Object::Role::Detract
Data::Object::Role::Dumper
Data::Object::Role::Output
Data::Object::Role::Throwable
This package adheres to the requirements in the folowing rule(s):
Data::Object::Rule::Comparison
Data::Object::Rule::Defined
To install Data::Object, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Object
CPAN shell
perl -MCPAN -e shell install Data::Object
For more information on module installation, please visit the detailed CPAN module installation guide.