Persistent::DataType::Base - An Abstract DataType Base Class
### we are a subclass of ... ### use Persistent::DataType::Base; @ISA = qw(Persistent::DataType::Base);
This is an abstract base class used by the Persistent framework of classes to implement the attributes of objects. This class provides methods for implementing data types.
This class is not instantiated. Instead, it is inherited from or subclassed by DataType classes.
This class is part of the Persistent base package which is available from:
http://www.bigsnow.org/persistent ftp://ftp.bigsnow.org/pub/persistent
Before we get started describing the methods in detail, it should be noted that all error handling in this class is done with exceptions. So you should wrap an eval block around all of your code. Please see the Persistent documentation for more information on exception handling in Perl.
### set the debugging flag ### $object->debug($flag); ### get the debugging flag ### $flag = $object->debug();
Returns (and optionally sets) the debugging flag of an object. This method does not throw Perl execeptions.
Parameters:
If set to a true value then debugging is on, otherwise, a false value means off.
eval { my $datatype = new Persistent::DataType::Object(@args); }; croak "Exception caught: $@" if $@;
Initializes a data type object. This method throws Perl execeptions so use it with an eval block.
This method is abstract and needs implementing.
eval { ### set the value ### $datatype->value($new_value); ### get the value ### $value = $datatype->value(); }; croak "Exception caught: $@" if $@;
Returns (and optionally sets) the value of a DataType object. This method throws Perl execeptions so use it with an eval block.
$cmp_op = $obj->get_compare_op();
Returns the comparison operator of a DataType object. This method does not throw Perl execeptions.
Can return a couple of different comparison operators:
if the value of the object should be compared as a string.
if the value of the object should be compared as a number.
Persistent, Persistent::DataType::Char, Persistent::DataType::DateTime, Persistent::DataType::Number, Persistent::DataType::String, Persistent::DataType::VarChar
This software is definitely a work in progress. So if you find any bugs please email them to me with a subject of 'Persistent::DataType Bug' at:
winters@bigsnow.org
And you know, include the regular stuff, OS, Perl version, snippet of code, etc.
David Winters <winters@bigsnow.org>
Copyright (c) 1998-2000 David Winters. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Persistent::Base, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Persistent::Base
CPAN shell
perl -MCPAN -e shell install Persistent::Base
For more information on module installation, please visit the detailed CPAN module installation guide.