perlmodules.net is back up

On Jan 10th I had said in a post here, that perlmodules.net 's update (to use the new metacpan API) would take 1-2 weeks.

It took 1-2 months. (two in fact)

Now it's up again.

Sorry.

Huge congrats goes to Olaf A. for fixing my code.

Bye.

Note to perlmodules.net's users: Since you must have gotten a ton of emails from the website today regarding all the CPAN module releases that have occurred in the past 2 months, you are advised to check also your spam folder, since some of the emails might have ended there by your mail provider (it might have mi…

perlmodules.net is down for 1-2 weeks

Because metacpan.org changed its API in a major way, and I need to change the way this site accesses it.

Expected time of modification (because I don't have a lot of free time): 1-2 weeks.

Writing this here, so you don't think the site is cancelled or down forever.

I made a multiple-insert as well as other methods for Mojo::Pg

The code is in this gist

insert_multi_p will let you insert multiple rows in Postgres with a single query, like this:


await $db->insert_multi_p(
    'table_name',
    [
       {
          ... anything you'd be able to write in insert_p ...
       },
       {
           ... second row to insert ...
       },
       ... etc ...
    ],
    {
         ...normal pg insert options...
    },
);

Lots of other interesting methods in there, that I use in my proj…

A pipe operator exists on perl v5.42?

You know how many languages have a "pipe" operator, either ready or in the making? Like PHP, here, for example: https://laravel-news.com/the-pipe-operator-is-coming-to-php-85

Well, Perl v5.42 (almost) has that too! Check these examples:


$ perl -E 'say "Alexander"->&CORE::substr(1, 3);'
lex

$ perl -E 'say ","->&CORE::join(qw/ 10 20 30 /);'
10,20,30

I believe this would work with any user defined or imported subroutine too, instead of th…

How to properly and immutably create a timestamp for a document (using Blockchain technology)

I had written a Math paper which was not good enough to be published in a journal, yet I wanted to have proof of the date I wrote it on so I could post the paper on the web without other people later being able to question who first came up with the idea.

The way I thought was more correct to do this was to publish the paper's sha256 checksum on the Bitcoin blockchain. Posting the SHA on social media (such as x.com) was not enough, as paid members can edit their old posts.

I got in touch with BBRTJ, the maintainer of Bitcoin::Crypto, who was very helpful in teaching me how to use his module and achieving my aim.

The goal, he told me, was to include the SHA256 checksum as the comment (technically the 'NULLDATA') of a small bitcoin transaction.

  1. I created a BTC address with Perl, using Bitcoin::Crypto
  2. I transferred a very few dollars worth of BTC to this address
  3. I found the transaction ID at mempool
  4. I found the index number of the ouptut of the transaction that got crypto into my address, because this number together with the transaction ID are what form the UTXO
  5. I used this UTXO as input (funds) in a new transaction that had two outputs: One output was the NULLDATA string (the "comment" that contains the SHA256 checksum of the PDF document), and the other was a "change" address of mine, which would receive the rest of the money from the UTXO (full amount minus transaction fee (around $1)).

Please visit my blog to see these steps in more detail, and with code.