Specifying dependencies for your CPAN distribution

In this article I'm going to show you how to specify dependencies for your CPAN distributions: the other Perl and CPAN modules that your distribution relies on. This is the fourth article in a series. The first article gave a general introduction to distribution metadata. The second article introduced the five phases for which dependencies, or prerequisites, can be specified. The third article presented the types, or relationships, that can be specified for each dependency.

This article is brought to you by cPanel, Inc., a Gold sponsor for the Perl Toolchain Summit. cPanel are a well-known user and supporter of Perl, and we're very grateful for their support. More about cPanel at the end of this article.

Virtual Spring Cleaning - in which wild modules ambush me

In April, Google announced that Google Chrome was finally supporting headless mode, at least on Linux and Mac OS. Back then, I noted to myself that this might be a good time to revisit my rough prototype of WWW::Mechanize::Chrome. According to Git, I had written a first prototype of it in 2010 which used the old, raw socket protocol. But time has progressed and the protocol now uses Websockets. My original approach used AnyEvent, so I quickly replaced my own approach using AnyEvent::WebSocket::Client, and the HTTP parts with Future::HTTP.

Perl 5 Porters Mailing List Summary: April 27th - May 8th

Hey everyone,

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

Enjoy!

\d does not validate numbers

http://stackoverflow.com/questions/43814055/easy-to-check-if-user-input-is-a-number-in-perl

points us to this Perl FAQ:

http://perldoc.perl.org/perlfaq4.html#How-do-I-determine-whether-a-scalar-is-a-number%2fwhole%2finteger%2ffloat%3f

Unfortunately, the regular expression part of the above FAQ page is wrong. \d doesn't validate numbers, unless you have already verified that your input contains only ASCII characters.

What \d does is to validate whether a number is regarded as a numeral in Unicode. For example, \d will happily match things like U+07C2: '߂' NKO DIGIT TWO, or 096F: '९' DEVANAGARI DIGIT NINE, and 360 other characters which are not valid as numerals. If you need to use a regular expression to validate whether something is a number, use [0-9] to match digits, not \d.

For more examples of what characters match \d, please see

https://www.lemoda.net/perl/what-matches/what-matches.cgi?regex=\d

The source code for the script is here:

Perl short string implementation is interesting

Perl short string implementation is interesting.

add SHORT PVs

This decrease memory accesses when string is short in 16-bit.

Type::Tiny 1.2 Coming Soon

Or 1.002000, because it uses Moo-like versioning.

The Type::Tiny 1.1 (1.001_00x) development cycle has been going on since September 2014. Apparently I'm either very concerned about stability or very lazy. You can make up your own minds about that.

But Type::Tiny 1.2 should be released in a few weeks. If your application uses Type::Tiny, you may want to download the latest development release and check that nothing breaks. (It shouldn't, but you never know until you try.)

The headline changes are:

  • Type::Params now has compile_named and validate_named.
  • Type::Tiny's constraint parameter may be a string of code.
  • Fixed bug where Types::Standard::Int would sometimes accept an overloaded object. (It never should.)
  • Various performance enhancements and bug fixes.

I'll explain the first two in more detail, because they're interesting.

Perl in a Business Application

Perl in a Business Application - Musings of an Architect

Everybody knows that Perl is not the right language for a large scale enterprise application. This is common knowledge, right? But why is that? Explanations are as many as there are people explaining. Everything from "it's a script language, therefore slow" to "its free syntax breeds discoherence" to "Perl developers are horrible individualists".

Well, I didn't believe this, and I went on to help in a startup which wants to build some fintech systems, the first aim of which is to integrate with Finnish banks and collect daily payments from a customer's bank account.

It was decided to use Perl as the core language. If Perl is (was) good enough for Goldman Sachs and Morgan Stanley it surely is good enough for us. So off to build a framework!

Two Failed Attempts for System Architecture

Perl5 to Java compiler - week 100 - bootstrapping

It's been a 100 weeks since the Perl5 to Java compiler started.

The compiler is now "good enough" to translate itself to Java.

# grab a copy of the project
$ git clone git@github.com:fglock/Perlito.git ; cd Perlito

$ make clean

# create the "perlito5.java" file
$ perl perlito5.pl --bootstrapping -Isrc5/lib -Cjava src5/util/perlito5.pl > perlito5.java

# compile to ".class"
$ time javac -J-Xms2000m -J-Xmx2000m -J-Xss2000m -source 7 perlito5.java
[ scary warnings ]

# create the perlito5.jar file
$ jar -cfe perlito5.jar Main *.class

# quick check
$ java -jar perlito5.jar -v
This is Perlito5 9.021, an implementation of the Perl language.

# run a test
$ java -jar perlito5.jar --bootstrapping -Isrc5/lib -Cjava t5/unit/array.t > x.java ; javac -source 7 x.java ; java Main
[ scary warnings ]
1..35
ok 1 - create array
ok 2 - set element
...

# test the bootstrapping
$ java -jar perlito5.jar --bootstrapping -Isrc5/lib -Cjava src5/util/perlito5.pl > x.java
$ diff x.java perlito5.java
[ no differences ]

The "--bootstrapping" flag tells the compiler that eval-string is not available. Eval-string is not yet implemented.

Lab::Zhinst - Perl bindings to the LabOne API of Zurich Instruments

The Lab::Measurement project provides Open Source control of test & measurement devices with Perl. On our recent poster, which was presented at this year's DPG Spring Meeting of the Condensed Matter Section, we mainly discuss the high-level aspects of Lab::Measurement necessary to perform highly complex measurement tasks with simple scripts.

Now, the topic of this post is the CPAN release of Lab::Zhinst, which provides a Perl5 interface to devices from Zurich Instruments, a vendor of fast digital lock-in amplifiers, phase-locked loops, arbitrary waveform generators, impedance analyzers, digitizers, and boxcar averagers. There is no doubt about the excellent performance of their hardware. But when it comes to measurement automation I'm quite frustrated. How come? I will explain by comparing their all-proprietary approach to the existing open interfaces. These open interfaces make it possible to control test & measurement equipment with general-purpose programming languages like Perl.

Deutscher Perl-Workshop 2017 - Call for Participation

The 19th German Perl Workshop will take place in roughly two months time in Hamburg. The German-speaking Perl Community will meet from the 26th to the 28th of June 2017 in the "Bürgerhaus Wilhelmsburg".

Mojolicious::Plugin::INIConfig 0.04 is released

Mojolicious::Plugin::INIConfig catch up Mojolicious 7.31.

Mojolicious 7.31 removed some DEPRECATED methods.

I fixed test and release Mojolicious::Plugin::INIConfig 0.04.

Enjoy!

How to get paid more, a guide for Perl programmers

So I wrote a guide on how to get paid more by understanding technical hiring processes:

https://www.slideshare.net/perlcareers/get-paid-more-the-anatomy-of-a-technical-hiring-process

Perl 5 Porters Mailing List Summary: April 17th-26th

Hey everyone,

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

Enjoy!

Call for Venue for the Perl Conference in Europe 2018 (formerly know as YAPC::Europe)

While we are all looking forward to the Perl Conference in Amsterdam, it is time for the venue committee of the YAPC::Europe Foundation (YEF) to think about the location of the 2018 conference. So if you always wanted to invite the European (and International) Perl Community to your hometown for three days of massive Perl, drop us a line at venue@yapceurope.org.

More information is available at the YEF website.

Announcing The Swiss Perl Workshop 2017

We are excited to announce The Swiss Perl Workshop 2017. This year the workshop will be held in Villars-sur-Ollon, in the French speaking part of Switzerland. The workshop will be in English.

The workshop will take place on Friday 25th and Saturday 26th of August 2017. You can find information on getting to Villars-sur-Ollon and places to stay on the workshop website.

Please spread the word, register, submit talks, and come enjoy a perl workshop in the mountain air. Oh, there will also be beer/wine/drinks and pizza from the real pizza oven at the GivenGain office (although we need to do a test run first).

Thanks to our sponsors:
OETIKER+PARTNER | Perl Careers | GivenGain

Virtual Spring Cleaning Interlude, in which I could do more for Perl

Do not ask what Perl can do for you, ask what you can do for Perl!

In my effort to bring the new signature back to older versions of Perl, I'm maintaining Filter::signatures, a source filter that simply converts the signatures to the equivalent old-style Perl code. That filter works surprisingly well for its simplicity and has caused very little in problems.

Specifying the type of your CPAN dependencies

This is the third article in a series on CPAN distribution metadata. The first article was a general introduction, and the second article looked at dependencies, and in particular the different phases that you can specify dependencies for (configure, build, runtime, test, and develop). In this article, we'll cover the different types of dependencies and how you combine these with the phases (described in the previous article) to specify the dependencies (or prereqs) for your CPAN distribution.

This article is brought to you by MaxMind, a gold Sponsor for this year's Toolchain Summit, being held next month (May) in Lyon, France. The summit is only possible with the support of our sponsors.

Machine learning in Perl, Part2: a calculator, handwritten digits and roboshakespeare.

Hello all,
In my first blog post I've announced AI::MXNet, Perl interface to the MXNet machine learning library.
The eight weeks that passed after that were quite fruitful, I've ported whole python's test suite, fixed multiple bugs, added docs, examples, high level RNN interface, Perl API docs has been added to the official MXNet website.
This time I'd like to review in detail three examples from the examples directory.
First one is a simple calculator, a fully connected net that is structured to learn four basic arithmetic operators: addition, subtraction, multiplication and division.
Second example is a comparison of two different approaches to the task of classification of handwritten digits, and the third one is an example of LSTM RNN network trained to generate Shakespeare like text.


Here is the image (generated by Graphviz ) of the calculator network.

The data input is two numbers, that are being routed via two paths; first path is turning the input values into natural logarithms and feeds these into one neuron sized fully connected layer.

Collisions in Block Names in Jemplate

Two Blocks with the Same Name

In January this year, I got Jemplate in the CPAN Pull Request Challenge. The module implements Template::Toolkit in JavaScript, so you can transfer the burden to process the templates from the server to the client.

One of the open issues in its GitHub repository caught my attention: Jemplate compiled all the templates coming from different files into one large JavaScript code-block. If you declared two blocks with the same name in two different files, they’d end up in the same hash in JavaScript, and only one would survive—but you couldn’t tell which one. Keeping block names unique across files probably isn’t part of common practice, so making the module warn you in such a case sounded like a reasonable requirement.

The Perl Conference USA 2017

The Perl Conference this year is going to be in the DC-Metro area, specifically in Alexandria, VA at the United States Patent Office. We've got some great talks lined up and are continuing to update the schedule at http://www.perlconference.us/tpc-2017-dc/schedule.

Register and reserve your spot to listen to speakers like Damian Conway, Mark Jason Dominus and Sawyer X to name a few. You can purchase tickets for our event and/or the tutorial sessions here.

The local PM groups (DC and Baltimore) are really excited about hosting this year's Perl Conference. I hope to see you there.


Dawn

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.