Don't use until, unless...

In Perl 5, until is a negated version of while. Instead of writing this:

while (defined(my $i = $iter->next())) {
    say $i;
}

Using until allows you to write this:

until (!defined(my $i = $iter->next())) {
    say $i;
}

until is documented under the "Compound Statements" heading of the perlsyn document.

Practice and policy

The thoroughly excellent book Perl Best Practices by Damian Conway (DCONWAY), the Black Wizard of Perl, exhorts us not to use the until control structure at all. The core policy set from the similarly excellent Perl::Critic dutifully implements the book's recommendation by raising low-severity warnings if you use it as a block:

until ($foo) {
    bar();
}

This yields:

"until" block used at line 1, column 1. See page 97 of PBP. (Severity: 2)

If you use it as a postfix control, an entirely different error arises from transgressing a different edict of Perl Best Practices' holy writ:

bar() until $foo;

This yields:

Postfix control "until" used at line 1, column 7. See pages 96,97 of PBP. (Severity: 2)

Application Metrics with Yertl

A time series database is a massively useful tool for system reporting and monitoring. By storing series of simple values attached to timestamps, an ops team can see how fast their application is processing data, how much traffic they're serving, and how many resources they're consuming. From this data they can determine how well their application is working, track down issues in the system, and plan for future resource needs.

There have been a lot of new databases and tools developed to create, store, and consume time series data, and existing databases are being enhanced to better support time series data.

With the new release of ETL::Yertl, we can easily translate SQL database queries into metrics for monitoring and reporting. I've been using these new features to monitor the CPAN Testers application.

Dancer2 0.205002 released; survey update

Dancer2 0.205002 has just been released and is on its way to your favorite CPAN mirror. Highlights include a number of documentation improvements (thank you, simbabque and ambs!) and the fixing of some lingering and pesky bugs (thanks to Nick Tonkin, Pierre Vigier, and our very own bigpresh, ambs, and veryrusty).

The full changelog is as follows:

vim, Ale, Syntastic and Perl::Critic

As a vim user, I've used Syntastic for a long time. It's a great tool for syntax checking. However, I was recently introduced to Ale . Ale does a lot of what Syntastic does, but it does it asynchronously. The practical benefits are
  • You should experience less lag when editing large files
  • Ale flags problematic lines containing errors and warnings in a gutter, making it easy to find problems
  • Detailed information about errors and warnings appear at the bottom of your buffer
I may actually be underselling it. Ale is almost a drop-in replacement for Syntastic. (At least it was for me). Try it out. I don't think you'll go back to Syntastic once you've tried Ale.

I'd like to point out a few configuration tweaks...

Read the full post at http://www.olafalders.com/2017/10/17/vim-ale-syntastic-and-perlcritic/

Bitcoin XS Modules

Summary

This is a library to allow users to write Bitcoin applications, including SPV nodes, in Perl. The library relies on a C library called picocoin . In order to get the library to work with Perl XS, some of the header files were modified and are located here . This set of Perl modules, the customized picocoin library, and all related dependencies have been compiled into debian packages.

This guide goes over setting up a simple HD Tree, drafting a P2SH transaction, and running an SPV client.

For instructions on how to install libcbitcoin-perl, see this page.

As for the Github page for libcbitcoin-perl, look here.

HD Trees

There are several ways to think about an HD Tree. Probably the simplest way is as a "Wallet".

Background

The Perl module CBitcoin::CBHD acts as an intuitive interface in handling BIP32 objects as described below:
  BIP: 32
  Title: Hierarchical Deterministic Wallets
  Author: Pieter Wuille <pieter.wuille@gmail.com>
  Status: Final
  Type: Informational
  Created: 2012-02-11

Perl 5 Porters Mailing List Summary: October 10th-15th

Hey everyone,

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

Enjoy!

graphql-perl - Mojolicious::Plugin::GraphQL - Mojolicious GraphQL endpoint

Having made a Dancer 2 plugin to easily make GraphQL endpoints, it only seemed fair to make a Mojolicious plugin to do the same thing. That has just been released to CPAN. There is also a sample applet for Mojolicious::Lite.

Sample code from the applet:

my $schema = GraphQL::Schema->new(
    query => GraphQL::Type::Object->new(
        name => 'QueryRoot',
        fields => {
            helloWorld => {
                type => $String,
                resolve => sub { 'Hello, world!' },
            },
        },
    ),
);
plugin GraphQL => {schema => $schema, graphiql => 1};

The next step will be to make GraphQL correctly handle asynchronous resolvers, using the excellent Future module.

The porting of GraphQL to Perl 5 is sponsored by Perl Careers.

graphql-perl - Dancer2::Plugin::GraphQL - Dancer2 GraphQL endpoint

The porting of GraphQL to Perl 5 (sponsored by Perl Careers) continues. With v0.12, released 10 Oct, it is possible to run queries and return results. This includes the introspection query built in to GraphQL.

Now there is a Dancer 2 plugin: Dancer2::Plugin::GraphQL. This allows you to make a Dancer2 app that serves GraphQL, and - if configured suitably - serve the superb GraphiQL interface to interactively explore and query your schema, with type-ahead.

There is also a sample Dancer2 app (as revamped by Nick Tonkin). Here is the heart of the code (see it on GitHub):

use Dancer2;
use GraphQL::Schema;
use GraphQL::Type::Object;
use GraphQL::Type::Scalar qw/ $String /;
use Dancer2::Plugin::GraphQL;
# ...
my $schema = GraphQL::Schema->new(
    query => GraphQL::Type::Object->new(
        name => 'QueryRoot',
        fields => {
            helloWorld => {
                type => $String,
                resolve => sub { 'Hello, world!' },
            },
        },
    ),
);
graphql '/graphql' => $schema;

6lang Naming Proposal is Good

I think 6lang naming proposal is Good

6lang: The Naming Discussion Update

I'm Perl programmer, not Perl 6 programmer. People seem to think Perl 6 is successor of Current Perl at first time.

It is strange that Version Number is contained in Language Name. We should admit this idea is wrong.

Perl 5 vs Perl 6 never produce any values. Many misleading occur and it damage Marketing of both Perl 5 and Perl 6.

Both children are damaged for a long time.

In Perl 6

Perl 6 is new language, has new paradigm, features, for example Parallel processing.

But Perl name call in our heart that it is traditional and plain old. Perl is King of script language Backward Compatible. Perl 6 is never so.

New Things need New Name. If old name is used, the value of new things is hard to see from normal people.

In Perl 5

Perl 5 wait to upgrade Perl 7. Ruby became Ruby 2, Python became Python 3, PHP became PHP 7. But Perl is Perl 5 for a long time.

Reset is needed from both perspective of Perl 5 and Perl 6.

Perl 7.0 and 6lang 7.0

If both language start to walk at each way, it is good.

How about Announcement of Perl 7.0 and 6lang 7.0.

proper planing (CP part IV)

After part one (main idea), two (prototypes) and three (sane boundaries of responsibility), I head toward the big picture. How does a project head coordinates planning under a "complete programming" (c) (tm) methodology.

There are many more details about planning in CP I left out for now, because it is already a lot to think about. In the next part I will write about the role of software tests in CP.

Announcing meta::hack v2

It's that time of year again. The core MetaCPAN hackers are going to be hacking on MetaCPAN next month. We are still looking for some sponsors. Read the full post.

I'm wondering how to learn good perl

I want to develop a website to introduce my restaurant chain and want to have functions related to customers and integrated booking. What should I learn about, my knowledge of basic HTML, CSS, Javascript, PHP, Mysql ...
I do not know anyone who knows this language.

Perl 5 Porters Mailing List Summary: October 2nd-9th

Hey everyone,

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

Enjoy!

Docker based Continuous Integration for perl projects

Here are the steps to getting started

  • Login to Shippable using your GitHub or Bitbucket credentials.
  • Enable the project

On the Shippable landing page, select your subscription from the Subscriptions dropdown. This should be the subscription where you forked the repository. Click on your GitHub/bitbucket name


subs.png

click on the Enable Project button. If you have not enabled any projects on Shippable, you will be directly be taken a page which shows a list of your repositories.


Find the Docker-CI-perl project and click on the Enable button. You will be taken to a page which shows that Status as Not built, towards the right of that table there is a build button. Click on that to start a build.
while the build is running you can on the id ( # column ) to look at the console. Once the build is done you can look at the test results.

Dancer 2017 Survey: Update

We are a week into the Dancer 2017 Survey, and we have received 77 responses to date. The Core Team has received a lot of great feedback from the community so far, and it has already resulted in some exciting new work, the most notable of which being the release of Dancer2::Plugin::Websocket by Yanick.

The Dancer Core would like to thank those of you who have taken the time to respond thus far, and would like to encourage those of you who have yet to respond to take a few minutes and give us your feedback. You can help determine the future of Dancer!

If you are interested in helping with Dancer, but are unsure of where to begin, check out the list of issues on Github. There are a number of issues that are not only tagged as being up-for-grabs, but many are even beginner suitable. If you have any questions, please engage with us on IRC, Github, or our mailing list.

On behalf of the Core Team, thank you, fellow Dancers!
Jason

Perl 6 at the London Perl Workshop - 25 Nov 2017

Been half-following Perl 6 development and wondering whether it's for you? This year's London Perl Workshop (Nov 25th) features:

Perl 6

Simon Proctor gives us "Perl 6: A Whistle Stop Tour", aiming to answer the fundamental questions: is this useful? Could I use this in production? Should I use this in production? Why might I want to?

Granada's JMERELO looks into "Perl 6 as a first language". With its use of Unicode, generosity of operators and their combinations, and the amount of baked-in data structures, Juan argues Perl 6 makes an excellent choice for teaching programming and computational thinking, as well as more experienced developers who want to stretch themselves.

Don't want to just sit on the sidelines? Lance Wicks runs an interactive workshop on Bailador, the Perl 6 web framework, covering everything from rakudobrew up to the deployment and hosting of your first Bailador project. The workshop is designed to be beginner friendly: it doesn't matter if you're new to web development, Perl6 or Bailador, there's something for you.

Attendance at the London Perl Workshop is free of charge thanks to the generosity of our sponsors - you can signup and find out more about the conference here: http://londonperlworkshop.org

Fancy a Game of (Code) Golf?

Code golf, for those unaware, is a game designed to let you show off your code-fu by solving problems in the least number of keystrokes. It goes without saying that Perl lends itself well to golfing.

code-golf.io is a new website that lets you write such solutions, have them scored in real-time, and compete with other users on per-hole, per-language, and overall leaderboards.

The project is very young and will grow to have more holes, more languages, and more features over time, but it's also open source, so feel free to help it along. Patches welcome!

So come one, come all, and either add to Perl 6's dominance, or knock Perl 6 off the top spot with your awesome Perl 5 one liners! JavaScript, PHP, Python, and Ruby are also supported for the heathens :-P

Machine learning in Perl, Part3: Deep Convolutional Generative Adversarial network

Hello all,
Quick update on the status of AI::MXNet.
Recently MXNet proper got a cool addition, new imperative PyTorch like interface called Gluon. If interested please read about it at Gluon home page .
I am pleased to announce that Perl (as of AI::MXNet 1.1) is joining a happy family of Lua and Python that are able to express ML ideas with Torch like elegance and fluidity.
Today's code is from Perl examples, and if you would like to understand it deeper please read the details at Gluon DCGAN example .

Iridium Flare End-Of-Life

For twenty years Iridium Communications Inc has provided global communications with a fleet of 66 satellites, plus spares. For most of that time the satellites have had the same design, and a consequence of that design was their ability to produce very bright and predictable flares due to the reflection of the Sun off their Main Mission Antennae. Beginning January 14 2017, though, satellites of the original design are being replaced by a new design that does not flare nearly as often or as brightly.

Perl module Astro::Coord::ECI::TLE::Iridium, part of the Astro-satpass distribution, predicts these flares. It seems to me to be time to start thinking about how to retire this module.

Lab::Measurement: New lightweight backends for VXI-11 and USB-TMC

The Lab::Measurement project provides Open Source control of Test & Measurement devices with Perl. This post introduces the new Test & Measurement back end modules Lab::VXI11 and USB::TMC. Both VXI-11 and USBTMC are open standards and are supported by most modern T & M devices. They were developed as alternatives to the legacy GPIB (General Purpose Interface Bus). The main purpose of GPIB is to transfer text messages between the measurement PC and an automated measurement device, such as a digital multimeter. Beyond that, it defines various control commands for device triggering, setting end-of-message characters, reading a status byte and much more. VXI-11 and USBTMC provide a high degree of backwards compatibility with these features.

The photo shows the rear panel of an Agilent 34410A digital multimeter. While it is a small and (relatively) cheap device, it supports four different automation standards (GPIB, USBTMC, VXI-11, raw TCP sockets). This is why I used it for most of my testing.

agilent-back-panel.jpg

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is hosted by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.