View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Joshua Nathaniel Pritikin > ObjStore-1.59 > ObjStore::Reference


Annotate this POD

View/Report Bugs


ObjStore::Reference - a listing of APIs


Fortunately, you will probably not need to use most of the API. In general, the API mostly mirrors the ObjectStore C++ API. Refer to the ObjectStore documentation for exact symantics.


Primarily, the API is exhibited here to make it seem like this extension has a difficult and steep learning curve (it doesn't).

The API for ::UNIVERSAL is probably of greatest interest to ex-C++ developers.




Also see ObjStore::HV::Database.



ObjectStore transactions and exceptions are seemlessly integrated into perl. ObjectStore exceptions cause a die in perl just as perl exceptions can cause a transaction abort.

    begin 'update', sub {
        $top = $db->root('top');
        $top->{abc} = 3;
        die "Oops!  abc should not change!";       # aborts the transaction
    die if $@;

There are three types of transactions: read, update, and abort_only. The default is read. Read transaction are blindingly fast.

    begin 'read', sub {
        my $var = $db->root('top');
        $var->{abc} = 7;        # write to $var triggers exception
    die if $@;

(In a read transaction, you are not allowed to modify persistent data.)

Dynamic transactions are also available. See ObjStore::Serve.



Easy event dispatching for network distributed objects. See ObjStore::notify.


All persistent objects inherit from ObjStore::UNIVERSAL.

To make everything seem apparently consistent, ObjStore::Database (while not really being a storable object) is lavishly special-cased to support most (maybe all!) of the above features.

syntax highlighting: