GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
NOTEDB::binary(3) User Contributed Perl Documentation NOTEDB::binary(3)

NOTEDB::binary - module lib for accessing a notedb from perl

        # include the module
        use NOTEDB;

        # create a new NOTEDB object
        $db = new NOTEDB("binary", "/home/tom/.notedb", 4096, 24);

        # decide to use encryption
        # $key is the cipher to use for encryption
        # $method must be either Crypt::IDEA or Crypt::DES
        # you need Crypt::CBC, Crypt::IDEA and Crypt::DES to have installed.
        $db->use_crypt($key,$method);

        # do not use encryption
        # this is the default
        $db->no_crypt;

        # get a single note
        ($note, $date) = $db->get_single(1);

        # search for a certain note 
        %matching_notes = $db->get_search("somewhat");
        # format of returned hash:
        #$matching_notes{$numberofnote}->{'note' => 'something', 'date' => '23.12.2000 10:33:02'}

        # get all existing notes
        %all_notes = $db->get_all();
        # format of returnes hash like the one from get_search above

        # get the next noteid available
        $next_num = $db->get_nextnum();

        # modify a certain note
        $db->set_edit(1, "any text", "23.12.2000 10:33:02");

        # create a new note
        $db->set_new(5, "any new text", "23.12.2000 10:33:02");

        # delete a certain note
        $db->set_del(5);

        # turn on encryption. CryptMethod must be IDEA, DES or BLOWFISH
        $db->use_crypt("passphrase", "CryptMethod");

        # turn off encryption. This is the default.
        $db->no_crypt();

You can use this module for accessing a note database. There are currently two versions of this module, one version for a SQL database and one for a binary file (note's own database-format). However, both versions provides identical interfaces, which means, you do not need to change your code, if you want to switch to another database format.

Currently, NOTEDB module is only used by note itself. But feel free to use it within your own project! Perhaps someone want to implement a webinterface to note...

please see the section SYNOPSIS, it says it all.

Thomas Linden <tom@daemon.de>.
2016-07-29 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.