Little Moose Day

Just a short note for the Moose-Pen toady, I am going to clean finish off my Moose droppings by looking at the Expression.

Well all I really have to do is do a search and replace on the word function in my last post and and then past is here but that would be cheating. If I did do that I would at least see if anyone is reading these apart from Gabor.

So I will be working the 14_predicate.t and adding in the following;

CPAN Day: Tuesday 16th August 2016

CPAN Day marks the day when the first distribution was recorded as being uploaded to CPAN. That was 16th August 1995, so we've been uploading modules for 21 years now!

On CPAN Day you could release something to CPAN, send a pull request on someone else's distribution, blog about Perl, or just head to the pub with fellow Perl hackers.

Sparrowdo automation. Part 5. Managing services and processes.

HI!

This time I want to tell you how to manage services and processes using sparrowdo.

Before this post a following list of topics was written by me:

As services are highly coupled with processes we will investigate them in one post.

Let's have an nginx web server gets installed on your system:

Migrating from Mojolicious::Plugin::Swagger2 to OpenAPI

Mojolicious::Plugin::OpenAPI is close to being stable so i figured it was time to migrate from our use of Mojolicious::Plugin::Swagger2. Here's the differences i found, with the observation that perhaps some of these were down to having an older version of Swagger2 (0.79, although Changes log suggests that might not be the case):

Moose Show off

Today in the Moose-Pen I am going to cleanup up more Moose droppings. Now I already added in the Function and Expression class and came up with a few modest tests case for them '19_function_expression.t'.

Not that is fine and good for a unit test on that class but the problem is these two classes will never be used as stand alone classes they will always be used inside other objects typically in the same place I would use a Param or Element class and most of the time in a Predicate object.

The best place to basic unit tests of both Function and Expression is in the predicate unit tests case ' 14_predicate.t ' so in there I add firsts added;

Geekuni teams up as sponsor with the Perl Dancer conference

Geekuni provides Perl training for professionals
and joins us as bronze sponsor.

A lot of thanks for helping us turn the Perl Dancer Conference into a
truly amazing event!

Need your team to tune into the Dancer beat? Enrol them at Geekuni!

More sponsors are welcome, please see more details on our Homepage.

DEFCON fail

Long-time Perlista hfb reports from a sadly regressive DEFCON:

https://plus.google.com/+ElaineAshton/posts/Eh9vDGFhy7w

Teach Makefile.PL to use cpanm

I like to keep my perl modules lean when it comes to dependencies. But then again, CPAN is just so wonderful with all the helpful packages available. So there are always dependencies.

When writing perl modules, more often than not a few dependencies creep in … which makes it a whee bit awkward when developing the module, because I then have to somehow install these dependencies, and I would rather not get them all over the place but neatly in the module directory so that I have at least a semblance of a stable development environment.

So here goes my solution: A little postamble method for my Makefile.PL.

Details on Medium

Moose Delegates

Today in the Moose-Pen I am going to look at something new 'Native Delegations' on attributes or to say it another less wordy way 'Traits'

Native Delegation is a way to let you treat standard Perl data structure as if they where objects. So to take an example from my test cases say you have this

foreach my $index2  (0..(scalar(@{$predicates[$index]->predicates()})-1)) {
that (scalar(@{$predicates[$index]->predicates()})-1)) is not very readable. Now suppose we could just have this

($predicates [$index]->predicates()->count-1)

Portable GitHub system "GitPrep 2.3" is released - At last, "Issues system" is added. "Bug tracking" available!

Portable GitHub system "GitPrep 2.3" is released at 2016-08-06.

Finally, "issues" system is added. You can use "Bug tracking" on GitPrep.

And contain bug fixing, added features.

  • support issues system
  • support markdown table
  • support markdown foo_bar_baz

At first, Let's try
GitPrep example. You will find GitPrep is real portable GitHub system.

The features of GitPrep

I introduce the featrues of GitPrep for people who see GitPrep for the first time.

  • Github clone: GitPrep has the same interface as GitHub.
  • Support issue system
  • Portable: You can install GitPrep on your own Unix/Linux server.
  • Only needs Perl 5.10.1+.
  • Smart HTTP support: you can pull and push repository via HTTP.
  • Built-in web server, and reverse proxy support.
  • CGI support.
  • SSL support.
  • Public key authentication support

Installation is very easy. You run only two commands. Difficult settings is unnecessary.

Even if you have troubles by your mistake, for example "git push -f origin master", you can access all of your git repositories directory and fix them.

quepadre


i'm using padre editor with strawberry perl bundled in
dwimperl

i have multiple files open, then when i click on one of the
tabs to close 1 file, padre crashes without an error message,
the application just closes.
this also happens when i save the session.
kinda frustrating.
do you discuss padre here or am i in the wrong forum?
thank a bunch in advance

Perl 6 Core Hacking: Where's Da Sauce, Boss?

Read this article on Perl6.Party

Imagine you were playing with Perl 6 and you came across a buglet or you were having some fun with the Perl 6 bug queue—you'd like to debug a particular core subroutine or method, so where's the source for it at?

Asked such a question, you might be told it's in Rakudo compiler's GitHub repository. Depending on how deep down the rabbit hole you wish to go, you may also stop by NQP's repo, which is a subset of Perl 6 that's used in Rakudo, or the MoarVM's repo, which is the leading virtual machine Perl 6 runs on.

The answer is fine, but we can do better. We'd like to know exactly where da sauce is.

Stick to The Basics

The most obvious way is to just use grep command in the source repository. The code is likely in src/ directory, or src/core more specifically.

We'll use a regex that catches sub, method, and multi keywords. For example, here's our search for path sub or method:

Little Moose Tries to Run

Well more testing and re-factoring with just a little Moose in the Moose-Pen today. So I spend a good deal of time getting my tests cases all in a row. Now just a few interesting details on that, I created a number of generic utility tests that can be reused in my test cases. What I did was take the 'cmp_deeply' test like this on in 33_constants.t

Perl's Pegex Module: a great way to parse files by creating grammars

We recently came across Pegex and found it to be an interesting module for parsing text data. Instead of using regular expressions directly, the user can write a grammar for the data to be parsed. The data can be automatically converted to a native Perl object or, if the user desires, it's possible to use actions to handle the grammar while parsing using a Pegex::Receiver class.

Pegex uses the type of grammars called Parsing Expression Grammars (PEG), which is an unambiguous form of writing a grammar. Each parsed string will in effect have a single valid parse tree. Since Pegex converts the rules of the grammar to regular expressions, it is a greedy parser.

In this blog post we demonstrate how to easily use Pegex to parse an /etc/hosts file on Linux and convert the result into Perl objects automatically without having to manually create any object.

For more details check out the original blog post by me here.

Hello Dzone

Since the Perl Magazine sadly had to close i didn't wrote as many Perl articles anymore. Because I miss it sometimes I recently agreed to write for DZone. Its a Java- centric site with many light weight pieces. I read it myself, since you can find interesting stuff here and there.

But why I'm writing this here? In order to publish, it has to be transported from your blog. And since I don't own another blog and the Perl 6, Perl 5 and software engineering stuff I want to write about fits here nicely : I will use this blog as transport. for that purpose. So please don't wonder if some of my next text are here sound like I assume you never heard about Perl. If the entry is marked with the category DZone you know why.

But there is also another reason why I use this Blog. Since I will be a kind of press secretary for Perl in that area, I actually want to be controlled and corrected by you and also encourage you to engage in the discussions below these articles on DZone (link will be provided in comments), to make Perl more visible to outside world.

peace

All Good Things

Yesterday I announced the end of The Lacuna Expanse, the first massively multiplayer Perl-based web game. 

Relax it is Just Moose

Well it clean-up and re-factor day in the Moose-pen. So no new Moose Majick today just cleaning up and adding in stuff that I have left out (forgotten actually) and moving things about.

Well the first thing I did was finish off the last three of my remaining Accessor attibutes, 'gathers', 'filters' and 'sort' or if you are SQL inclined 'group by', 'having'. and 'sorts'.

The 'gathers' and 'sorts' attributes are just a pair of 'ArrayRefofElements' which I covered off in this post and types and the 'filters' is a 'ArrayRefofConditions' which I covered in this post. I did of course spend a little time making sure that my DAD role attributes matched up with the accessosr ones and as this is me programming I created two new test cases, 37_gathers.t that handles filters as well, and 39_sorts.t

Perl 5 Porters Mailing List Summary: July 27th-31st

Hey everyone,

Following is the p5p (Perl 5 Porters) mailing list summary for the past week. Enjoy!

Hacking on The Rakudo Perl 6 Compiler: Mix Your Fix

Read this article on Perl6.Party

While testing a fix for one of the Less Than Awesome behaviours in standalone Signature objects, I came across a bugglet. Smartmatching two Signatures throws, while spilling a bit of the guts:

<Zoffix> m: my $m = method ($a: $b) { }; say $m.signature ~~ :($a, $b);
<camelia> rakudo-moar 46838d: OUTPUT«Method 'type' not found for invocant of class 'Any'␤ in block at line 1␤␤»

So I figured I'll write about fixing it, 'cause hacking on internals is lots of fun. Let's roll!

Golf It Down

The less code there is to reproduces the bug, the fewer places there are for that bug to hide. We have a detached method and then we smartmatch its signature against something else. Let's try to golf it down a bit and smartmatch two Signatures, without involving a method:

<Zoffix> m: :($a, $b) ~~ :($a, $b);
<camelia> rakudo-moar 46838d: ( no output )

Comparing Perl, Python and Ruby's testing ecosystems, part 2

I've released the second part of my series comparing Perl, Python and Ruby's testing ecosystems, on my testing-focussed blog

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.