My First Perl6 (Part the First)

Well since I was in Olten anyway for the SWP I might as well take in the Perl6 workshop. I initialy signed up to do some install testing on windows 64 which according to the many rumors I have herd it would be a nightmare wrapped up in a nice bow.

So after arriving a little later than expected and seeing the good old familiar faces I grabbed a seat and began to play.

The first stop was getting started page on Perl6.org and within a few mins of poking about I found the Rakudo page followed the link there to the MSI page clicked the button and bingo-bango-bongo of and ready with Perl6.

Well so much for Perl6 being hard to install.

Well next I tackled a few simple scripts the normal 'hello world' type scripts and a few other ones and of course this gets very boring very quickly unless your idea of a good time is trying our regex but that is more like my nightmare.

Preparing for a Technical Interview (with Perl)

I've uploaded some more slides, this time from my YAPC::NA masterclass, on how to prepare for and survive a technical interview. They are somewhat Perl-related, but most of the content should be as applicable for non-Perl interviews too.

How to prepare for (and survive) a technical interview

Amazon AWS EC2 and Cluster SSH

Cluster SSH, or its OSX incarnation CsshX are great tool to quickly connect to a collection of machines and issue interactive commands in parallel. You just configure them with a collection of machines called 'clusters', set your .ssh/config correctly for all those boxes and voila, you are now in the matrix.

The problem arise when you run your stuff on Amazon's AWS on EC2 dynamic instances. It's impossible to know at a given time which instances are effectively running, and it makes your cssh (or CsshX) configuration useless.

The good news is, Amazon provides an API to access and manage EC2 instances. The even better new is there's a Perl package to access that programmatically. So..

Lets put EC2 API Access and Cluster SSH together: ec2-cssh

Read more here ..

Just announced: PPW talk deadline extended!

Calling for all talks! The Pittsburgh Perl Workshop has already received some great talks - and we're looking for a few more! Having already confirmed that Larry Wall will be attending this year's workshop to discuss the release of Perl 6 - the organizers are looking to include two tracks of great talks!

Talk submissions will continue to be accepted through Friday, August 28th. Visit pghpw.org/ppw2015 for more details and to submit your talk!

PPW will be held in downtown Pittsburgh on October 9–11 2015.

Ad-Hoc OLAP databases with Yertl and HANA

In my previous posts I showed how to set up an ODBC connection to cloud-hosted HANA (HCP) and then, in a follow-up post, I drawned on moving data over such channel on the fly using an ETL fremework called Yertl. In less then two weeks I will be giving a short talk at YAPC EU 2015 related to these topics. Specifically, I would like to share some ideas about building ad-hoc OLAP databases using the two tools (Yerlt and HANA).

Q&A Session with Larry Wall at Swiss Perl Workshop 2015

Only seven days left (and six to the start of the Perl 6 Hackathon).

Now, we need you, even in case your are not attending.

Larry Wall will answer your questions in a Q&A session on Friday at 10:50 hrs CEST.

Please ask everything you ever wanted to know about Perl and the "Perl universe" and send your questions to spw@perl-workshop.ch or add your comments to this blog post.

swat for Dancer

SWAT is simple DSL to create a smoke tests for any web application in easy and fast way. Recently I have created some tests for well known perl web framework Dancer. This tests might be used by Dancer developers as simple smoke tests suite could be run at any CI platform.

dancer.png

Starting to Learn Regexes in Perl 6

So I was looking for a script to convert that had a regex, to play with some of the new regex stuff. I picked one that I thought was laughably simple and small, and I'm glad I did, because it still took a while to convert.

Getting big without getting fat, in perl

I presented this talk last night at Sydney PM to a crowd of 12 enthusiastic mongers. Thanks to Catalyst-IT for hosting us, and for shouting free pizza and drinks!

We got stuck for a while explaining to people what mix-ins and roles are... thankfully this is a slide pack so you dont have to endure the endless attempts to find useful metaphors. Also my typo of Role::Tony seemed to endlessly amuse, so I have left that in place.

Moving data around with Yertl over ODBC (to HANA)

Probably, the first Perl blog post that I read this year — or even the first thing I read this year ;) — was "Managing SQL Data with Yertl" by Doug Bell about a nice ETL freamework that he wrote. The framework comes with a set of command-line tools that let you extract, munge and move data between different SQL databases.

As I was struggling at that time with getting some reports running against an old OLTP database, which I was very reluctant to touch, I thought of writing a tool extract, let's say, the last quarter of data, re-model the schema and move the data to HANA DB, which exposes MDX interface. A simple extract-load task can be easily implemented by chaning two ysql processes:


ysql query mysql-local "select * from EntryExternal" | ysql write hana-trial "insert into Entries (caption,category,finalPrice,finalized,resolved) VALUES ($.caption, $.category, $.finalPrice, $.finalized, $.resolved)"

File::Slurp is broken and wrong

If you are using File::Slurp, you should possibly reconsider. Basically, there are three reasons to do so;

It is wrong in a lot of cases.

File::Slurp predates IO layers, and as such doesn't take them into account well. A few years ago, after some complaints, an attempt was done to make it handle encodings. This was nothing short of being wrong.

The best known bug in this area is #83126, which means that :encoding() layers are always interpreted as :utf8. This not only means that UTF-8 encoded text is not validated (which can be a security risk), but also that files in other encodings (such as UTF-16) will be read as UTF-8, which surely will give an incorrect result.

Likewise it's not handling :crlf correctly, in particular explicitly asking for :crlf will always disable it, even on Windows.

Basically, it's doing all binmodes wrong except the one you shouldn't be using anyway (:utf8), and you should pretty much always be using a binmode, so there's no way to win really.

Last Minute Hotel Rooms @ Swiss Perl Workshop

The organisers of the Swiss Perl Workshop would like to inform you that they are freeing some hotel rooms by tomorrow, Wednesday 19 August, 18 CET.
The rooms are in the hotels Amaris and Oltnerhof, both within 5 minutes on foot from the venue.
Reservations were made for the duration of the workshop, Perl 6 hackathon included (Wednesday 26 August - Sunday 30 August)

Perlito - reviewing some older code

Today I've finally updated the Perlito compiler ChangeLog, this covers a little more than a year of commits.

The most significant update was the new Perlito5-to-Java backend, which is work-in-progress. It covers a lot of ground, but there is a lot more.

There were also some interesting new Perlito5-to-Javascript features, such as regex /e modifier, and file operators support in nodejs.

The Perl6 backends have not been updated, but things still work.

While reviewing the README-perlito6 file, I've found some interesting stuff that I haven't touched in a while - here is a piece of generated code that goes through 3 different languages:

CPAN is 20!

Perl hackers have now, as of today the 16th August 2015, been uploading Perl modules onto CPAN via PAUSE for 20 years. Andreas König, who did that first upload, is still releasing to CPAN, and as I write this his most recent upload is the same module that was first released to CPAN.

This post is a brief summary of CPAN's history.

Happy CPAN Day!

Can you believe CPAN has been around for 20 years today? Two decades is a long time! Yet, I cannot imagine my workday without it.

My contributions to the CPAN Day celebration:

Helios 2.83 is a minor release of the Helios distributed job processing framework. It contains official SQLite support for the first time, better schema DDL for Oracle databases, and some cleanup of some files with mixed-format line endings.

Helios::Logger::HiRes 1.00 is the first stable release of a plugin module
providing enhanced logging features to the Helios framework, including
sub-second timestamp precision (provided by Perl's Time::HiRes) and a
command line log searching tool.

Thank you to everyone who contributes to CPAN, both package contributors and those that maintain CPAN itself. Happy CPAN Day everyone!

The newly-released Regexp::Assemble V 0.36

I'm now co-maint of Regexp::Assemble. V 0.36 has been uploaded to CPAN.

Perl開発の助成金プログラムについて

This is a Japanese summary of Grants Committee Charter, How to write a proposal and Grant Benefits.

YAPC::Asiaが目の前に迫ってきました。日本のPerl使いの皆様向けにThe Perl Foundation内のGrants Committeeの活動を紹介します。

以前Grants Committee委員の牧から案内がありましたように、Grants CommitteeはPerlの開発に貢献する個人に1万ドルを上限として助成金の交付を行っています。もちろん日本の皆さんも対象で、最近はmoznion氏のPerl::Lintが採択されました。以下に私たちの活動理念と助成金の応募方法を記します。少し長いですがどうぞお付き合いを。

Grants Committeeの紹介

Grants Committeeは米国非営利法人、Perl Foundation内の最大勢力を占める委員会です。

Grantは日本語に翻訳しにくいのですが、助成金委員会とでも申しましょうか。オープンソースの活動は個人が自分の時間を使って無報酬で行われることが多いものの、人間は霞を食べて生きるわけにはいかないため、Perlのプロジェクトを通してPerlの成長に貢献してくださる方にGrants Committeeが助成金を出しています。

委員長は私、野崎が務めています。委員はコミュニティの代表を世界各地から集める方針を取っており、アジア・太平洋地域からは牧大輔とKaren Pauleyが選出されています。その他北米4人、欧州の4人の委員に加え、アジア・北米・欧州からGrant Managerという役職に1名ずつついており計14人の所帯です。

助成金の申請から採択、支払いまで

流れはこのようになっています。

  • 提案の送付(フォーム)。このようなプロジェクトををするのでこれだけの助成をされたい、という内容を送っていただきます。メールアドレスなど個人情報を除き、内容は公開されます。
  • 奇数月の中旬にパブリックコメントを募集し、委員による投票が行われます。
  • 賛成多数で採択。提案に沿って実行していただきます。なお月一度の進捗報告が求められます。
  • 計画達成後、現金が支払われます。

参加する利点

採択されると助成金に加えてこのような利点があります。

  • 専属マネージャーが割り当てられ、進捗管理とTPF間の仲介をしてくれます。
  • TPFお墨付きのプロジェクトになり、世界中から注目が得られます。

FAQ的なもの

英語は必要か?

英作文が必要になるのは以下の場合です。

  • 提案の作成、質問への返答
  • 進捗報告
  • 支払い手続きなど事務的なやりとり

READMEを書く手間プラスαくらいでしょうか。牧によると「英語が問題ならば多少のお手伝いはできます」そうですよ!

申請額はどうやって決めたらよい?

上限が1万米ドルという以外、特にガイドラインは設けていません。過去の申請額を参考にするのがよいかと思います。なお2014年2月までは上限が3000ドルでした。

寄付金で成り立っているプログラムのため、時給換算ではさほど多くの額は望んでいただけないことをご承知ください。

支払いは?

計画達成後、委員会が確認したあとに米ドル建ての小切手が郵送されます。小切手はシティバンク銀行などで換金できます。銀行振り込みもできないことはないのですが、国際送金手数料の負担をお願いしています。

ちなみに円安の今がチャンスです。

財源は?

TPFに寄付をしてくださった皆様のおかげです。末筆ながらTPFに寄付をしてくださった法人・個人の皆様に感謝いたします。

お問い合わせ

tpf-grants-secretary at perl-foundation.orgへどうぞ。

Converting glob patterns to regular expressions

Let's say you have a glob pattern with shell-style wildcards from a config file or user input, where ? matches any character and * matches any string (0 or more characters). You want to convert it to a regex, maybe because you just want to match it (and Perl already supports regexes) or because you want to embed it as part of a bigger regex.

You might start with a naive replacement:

s/\?/./g;   # ? -> .
s/\*/.*/g;  # * -> .*

Unfortunately this is broken: It leaves all other characters untouched, including those that have a special meaning in regexes, such as (, +, |, etc.

Let's revise it:

Raise hell, or bugs, on CPAN Day!

If you've got one or more distributions on CPAN, then on CPAN Day you could go through them and see if there are any ideas you've had which aren't listed in the issue tracker (typically RT or github issues).

If you don't have any distributions on CPAN, then you could go through the modules that you regularly use and see if there are any issues you could raise.

I'll expand a bit on what I mean, and why it might be a good use of your time.

Seeking helpers for Net::DHCP

Are you sitting at home thinking "I've got all this free time, I really want to make use of it playing around with bitstrings using pack and unpack" ?

Your search is over! I need your help!

For some time now I have been chipping away at enhancements for Net::DHCP. Recently I have begun adding tests using packet captures from the real world. Naturally this has created a laundry list of possible enhancements including DHCP options which need special attention to make sense of.

That and the tangled web of quirky clients which require dhcp options to be in certain (non-numeric) order - for no logical reason.

I have a TODO list which is naturally just a list of ideas which some keen person with tie on their hands might like to help me with, check it out at: https://github.com/djzort/Net-DHCP/blob/master/TODO

Please fork and submit PR's!

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.