RxPerl release candidate is out

I was working on the completely fresh rewrite of perlmodules.net, when I decided I want to use WebSockets with this site.

So "innovations" started flowing through my mind in order to achieve WebSocketry, and ended-up deciding it would be very helpful if I could use ReactiveX on my Mojolicious site, in terms of size and neatness of the code, buglessness and maintainability.

This is how we ended up with RxPerl, a project I spent a lot of time to make it work well.

Now at version v0.16.0 on CPAN, it is a release candidate. I would like to ask anyone interested to take a l…

perlmodules.net remake

Hi. The current version of perlmodules.net was made in 2013/2014 with AngularJS, it is hard to update and so I’m starting a remake of the site.

Apart from an aesthetic makeover, it will be built with Vue.js/nuxt.js in order to allow the site to be indexed by all search engines. New features and ways of viewing the data may be added.

It will still use Mojolicious, but will use PostgreSQL instead of (the current site’s) MySQL, DBIx::Class instead of Rose::DB::Object, plus also Minion, RxJS, and will be o…

A very easy way to create XML

Back in 1999/2000 when I was first learning Perl, I read an article by a Perl advocate in which he said he believes Perl would become the best language to do XML with. Having been impressed by Perl’s power and ease-of-use (coming from C and Pascal) I imagined how great it would be if Perl’s strengths and ease of use were applied to XML-processing.

However years passed and I couldn’t find a module easy and intuitive enough for me for processing XML. So in 2006 I made my own pure-perl module for personal usage, called XML::MyXML.

It was so easy even I could use it. And I happily develop it until today.

Among other things (parse XML), it lets you treat XML as easily as JSON.

Here’s an example:

use XML::MyXML ':all';

print simple_to_xml(
    {
        a => {
            a1 => 123,
            a2 => 234,
            a3 => [city => 'New York', city => 'Boston', city => 'Moscow'],
        }
    },
    {tidy => 1},
);

Outputs:

<a>
    <a1>123</a1>
    <a2>234</a2>
    <a3>
        <city>New York</city>
        <city>Boston</city>
        <city>Moscow</city>
    </a3>
</a>

Or this example, if you want to create attributes (eg color=”blue”) in your elements:

my @points = ({lat => 10, lng => 10, color => 'blue'}, {lat => 11, lng => 11, color => 'red'}, {lat => 12, lng => 12});

sub point_to_simple {
    my $point = shift;
    my $color = $point->{color};
    return (
        # set (2n+1)'th element to be a ref instead of string, to easily set up element's attributes, not just tag
        [point => {color => $color}] => {
            coords => "$point->{lat},$point->{lng}"
        },
    );
}

print simple_to_xml(
    {
        'Points title="my points document"' => [
            map point_to_simple($_), @points
        ],
    },
    {tidy => 1},
);

This produces the following XML:

<Points title="my points document">
    <point color="blue">
        <coords>10,10</coords>
    </point>
    <point color="red">
        <coords>11,11</coords>
    </point>
    <point>
        <coords>12,12</coords>
    </point>
</Points>

I often have to generate KML files for Google Earth, and this module makes it possible with very short scripts.

You can find more about this module here: XML::MyXML on metacpan

Please write in the comments below, I’d like to know your opinion: Is it module good? Are there other easier-to-use modules on CPAN for this job? Is it powerful enough for others to use? Would you recommend it? And what do you think is missing from it to make it worthy of use by a wider audience?

Thanks!

You can import your Metacpan favorites into perlmodules.net!

PerlModules.net is a website that notifies you when your favorite modules get updated, via e-mail or RSS.

As of today, you can now import your favorites from metacpan.org into perlmodules.net.

And if your metacpan favorites list changes in the future, no worries: the corresponding feed in your perlmodules.net account will adapt accordingly.

Multi-user feeds in Perlmodules.net!

Perlmodules.net, the site that notifies you about new releases of your favorite modules, just got better for groups, with Multi-User feeds.

If you're part of a project team, and wish to have your team members be able to view and/or modify your feed(s), as of today you can.

The owner of the feed grants read or write access rights to any users they want. If one of these guest users modify the owner's feed (i.e. adds or removes some modules which are tracked by this feed), the owner will get notified by email about all modifications at the end of the day (only if…