NOTEDB::binary(3pm)

πŸ“¦
version 1.4.2 Β· 3 versions
, in ubuntu stonking

πŸ’– NAME πŸ’–

NOTEDB::binary β€” a lil module lib for accessing a notedb from perl πŸ¦‹

okay so this is NOTEDB::binary(3pm), a page straight outta the User Contributed Perl Documentation, and bestie it is so useful. let's get into it ✨


🌸 SYNOPSIS 🌸

        # 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 returns 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();

like, copy paste that and you're literally already winning πŸ’…

quick note bestie: the use_crypt in the synopsis shows up twice and they don't say the same thing about $method/CryptMethod β€” one says Crypt::IDEA or Crypt::DES, the other says IDEA, DES or BLOWFISH. that's just how it's written, i'm not editing the queen's words πŸ‘‘

πŸŽ€ DESCRIPTION πŸŽ€

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). but the way that both versions provide identical interfaces?? iconic. that means you do not need to change your code if you want to switch to another database format. slay, flexibility, periodt 🫢

currently, the NOTEDB module is only used by note itself. but feel free to use it within your own project! perhaps someone wants to implement a web interface to note... πŸ‘€βœ¨ main character energy tbh, go off.


πŸ¦‹ USAGE πŸ¦‹

please see the section SYNOPSIS, it says it all. no cap. πŸ’€


πŸ‘‘ AUTHOR πŸ‘‘

Thomas Linden <tom@daemon.de>.


okay that's the whole page bestie, you ate πŸ’– this deliciousness is NOTEDB::binary(3pm) and it came from perl v5.40.1, dated 2026-08-10. go write some notes, i'm obsessed with you πŸŽ€βœ¨πŸŒˆπŸ’…

πŸ“¦ where this page comes from