The Barter Perl API


Barter comes with three Perl modules to make interacting with the server as easy as possible. All of them come with the standard installation.


dmath

Using dmath will give you access to the following packages:

dmath::bz is used for representing RSA keys, and dmath::bq is used for representing quantity. The functions rsa_keygen and rsa_crypt will also be exported.


bom

Using bom will give you access to the following packages:

Essentially, the same objects covered in section 1., with the addition of the txn (transaction) object which facilitates local database transactions. The objects also know how to store themselves and their relationships on disk, using the same BerkeleyDB interface that the server itself uses. In order to use a database, you must call bom_db_init with a database directory as its argument. Well-behaved programs also call bom_db_exit upon termination.


bif

Using bif will give you access to the following packages:

bif::client allows you to talk to the Barter server. Its methods are the same as the server command names, but all arguments and return values are converted from/to the appropriate types defined in bom.