Perl + Pathfinder == <3

Chris Nehren will give a talk at YAPC::NA 2012 that he describes as:

I like Perl. I like tabletop RPGs (especially tabletop RPGs whose mechanics are licensed under the OGL, like D&D 3.5 and Pathfinder). I like Unix. And I like running games.

But I’m lazy. And running games is a *lot* of work. What’s a lazy GM to do? Solve the problem in as generic a way as possible, of course! I’ll give the computer some data and some instructions about how to do the tedious stuff (managing initiatives, monster health, combatant status, that sort of thing). Then, I can focus on the fun part—interacting with my players.

And as I like Unix, this means simple text files and a text mode interface. No Web servers or browsers needed—I want this to run offline and not kill my laptop’s battery.

So, in this talk I’ll be discussing some tools I’ve put together to make running an OGL d20 tabletop RPG easier. They may / may not be useful for anyone else. But hopefully they’ll be interesting on their own.

[From the YAPC::NA Blog.]

Unexpected PITA progress

Of all the Big Awesome Things I've tried to create over the years, PITA has been been one of the longest and most disappointing.

Conceived as the logical extrapolation of Perl's testing framework development into the future, the basic idea is zero conf 100% automatic testing in parallel across arbitrarily many different operating systems using one-time virtual machines.

Achieving that kind of process isolation in a way that doesn't require any manual setup and no human intervention has meant some extremely twisted internals and lots of unusual and complicated problems to solve.

Cph.pm celebrated CPAN's birthday

We held our monthly (almost...) meeting on the last Wednesday of the month instead of the last Tuesday, because it supposedly is CPAN's 16 year birthday.

Being a round birthday (choosing the right base notation), we celebrated with chips, sandwiches and drinks, kindly provided by Adapt A/S.

Amidst the talks about Perler's usage of git, there was also discussions about Monger Group's homepages. What do other groups use for this? Conferences have ACT, modules have PAUSE/CPAN. Blogs have this page.

Don't we have a canned .pm webinator?

So, what's new from Perl?

A few weeks ago I read a discussion thread that mentioned Perl. It might be about Mojolicious 2.0 release, on reddit, my memory is failing me. A commenter asked about what novel projects that originated from the Perl community the past several years (like the last 3 years).

Perl used to be the source of ideas that get copied to other languages, e.g. DBI, WWW::Mechanize, and its regex flavor. Now the tide has turned, and although that is not a bad thing, one might wonder the same question.

It's true that for web development, many new ideas nowadays come from Ruby/Python/JavaScript/and others instead of Perl (although "new" sometimes is very loosely defined). Nevertheless, Dancer is a port from Ruby's Sinatra, PSGI from WSGI/Rack, and so on. Some other projects also are "stolen" from other languages: perlbrew, cpanm (well not exactly, but the one-off command-line nature and verbosity reminds one of PHP's pear or rubygem client).

i-nigma

i-nigma :

i-nigma is one of the better QR Code readers for Windows Phone. Most importantly, it handles vCards. Since we’re using a lot of QR Codes at YAPC::NA 2012, do yourself a favor and get i-nigma, if you’re a Windows Phone user.

[From the YAPC::NA Blog.]

GCI 2011

The Perl Foundation is hoping to take part in the Google Code-in once again this year. This is a programme under which students aged between 13 and 17 are able to undertake short, well defined tasks for open source projects, and in return they will get a tee-shirt, a certificate, gain credits and can also be paid up to $500 for their work by Google. The ten students with the most credits at the end of the programme will also be invited to visit the Google headquarters.

This is a wonderful opportunity that we have to get young students involved in open source software in general and Perl in particular. One of the aims of the GCI programme is to find those who will become long-term contributors and ensure the future of open source projects. So if you want to help ensure the long-term viability of Perl, then please get involved with GCI.

Perl tutorials suck (and cause serious damage)

Before reading this entry, please note that this problem has been solved. You can now find fresh tutorials at the:

Perl Tutorial Hub



And now back to your scheduled rant:


PREFACE

On monday a blog post made the rounds that claimed "Perl users were unable to write programs more accurately than those using a language designed by chance." Naturally that is not the entire truth. As it turns out they "trained" their test subjects using examples of code that they considered representative of what a user would find when trying to learn Perl from the internet. That code looked like this:

$x = &z(1, 100, 3);

sub z{
    $a = $ [0];
    $b = $ [1];
    ...
    for ($i = $a; $i <= $b; $i++){
    ...
    if ($d > $e) {
        $d;
    }
    $e;
}

About finding module dependencies

Yet again I stumble upon the question: What modules do I have to install?

I found a recent discussion on stackoverflow, an old discussion of perlmonks, and some modules (Perl::PrereqScanner, used by Dist::Zilla; Module::ScanDeps, used by PAR; and CPAN::FindDependencies, as seen on http://deps.cpantesters.org/).

PrereqScanner does only static checking (i.e. it looks at the source), ScanDeps does both static and dynamic checking (i.e. it first looks at the source and then runs it). FindDependencies seems to examine Makefile.PL and Build.PL.

And then there's the something between the static and dynamic checking: Load a file, don't run it, and print %INC. (Since in the perl world "loading a module" means running code, this is definitely on the dynamic side.)

Neither of these approaches does what I want: Look at sources and tell me what modules I have to install. ScanDeps comes close: it excludes modules from the Perl distro. From its output I have to guess what modules to install: I guess that I get

Call for Presenters Open for YAPC::NA 2012

Submit a talk for YAPC::NA 2012. We’re especially interested in talks on real-world Perl apps and quintessential Perl 101 talks, but we’re open to any ideas you have. 

[From the YAPC::NA Blog.]

Perl Tutorial and the Internet

In response to Mithaldu's blog post, How do newbies find Perl learning materials online? Dave Cross, one of the best Perl trainers, have checked out what are the top results when searching for "perl tutorial".

I was very happy to see he thought my Perl tutorial is worth sharing with others.

My little experimentation into the world of promoting web sites lead to the belief that if I want to promote my web site I need to create content that people will want to link to. Also, I need to make it easy and fairly obvious how to link to the web site. That is, what should be the anchor text.

OTOH if you'd like to help promoting a web site or a specific web page make sure to include the expression people will likely use to find that specific thing.

Introducing Sub::Spec::HTTP::Server: Perl functions over HTTP, the dead easy way

Below is one way to serve function call requests (e.g. providing API service) using just one line.

Modules hitting CPAN mirrors as we speak (metacpan link: Sub::Spec::HTTP::Server):

# example module to export to HTTP, provides sprintfn()
$ cpanm Text::sprintfn

# module to do the magic, provides 'servepm'
$ cpanm Sub::Spec::HTTP::Server

$ servepm Text::sprintfn

$ wget -O- -q 'http://localhost:5000/api/Text::sprintfn?args:j=["Agent %(num)03d",{"num":7}]'
[200,"OK","Agent 007"]

Features:
  • Plack/PSGI-based
  • Support HTTPS natively, as well as Unix sockets (using Gepok PSGI server)
  • by default support JSON/YAML/PHP/text input/output (support complex arguments instead of just scalars)
  • more than just function call: usage, spec, list modules, list subroutines
  • propagates Log::Any log messages from server
  • use middleware to add authentication, authorization, etc.
  • support proxying

I also wrote Sub::Spec::Use, to easily use a remote module:

use Sub::Spec::Use "http://localhost:5000/api/Text::sprintfn" => qw(:all);
printfn "%(num)03d\n", {num=>7};

Document Driven Development

Maybe the most ibnteresting talk I held this season was about this DDD. This is just a sneak preview since I give it once more in Vienna and my concept will be much better after it. Then i will publish here entirely.

I borrowed the term a bit from the django-guys, even Al Iho (the a in awk) tought 20 years ago this way. (thanks cromatic to bring this to my attention). it solves several issues documentation and test driven development face (if your honest). And I don't think it eats up any exra time. Maybe at the beginning a bit but it pays of hugely.

the basic ideas are 2:

1. write docs before the tests, than the code. this way you refelct more and hav your docs always complete, up to date and ready to ship.

2. rewriting docs is part of every refactoring

i think we should write a clean perl book. just for the fun of the title. i really lough at the less upright from c't magazine that apologize at the beginning of a perl tutorial that it isn't hip.

in other news: my tutorial lerning programming with perl is still in the making and needs evey (German) hand it gets.

Perl 5: Today, Tomorrow, and Christmas

Ricardo Signes will give a talk at YAPC::NA 2012 that he describes as:

Year after year, Perl continues its steady march towards greater and greater Perlishness. Ancient mistakes are slowly sloughed off and long dreamed-of features are added. If Perl is evolving, toward what? Is it just a random collection of mutations, as desperate Perl hackers struggle to remain fit enough to survive, or is there an intelligent design behind the way Perl is changing?

In this session, Ricardo Signes (rjbs), the Perl 5 project lead, will discuss the future of the Perl language, the guiding principles of its ongoing design, and the specific changes toward which the Perl 5 Porters are working. It will also describe the way Perl 5 development really happens, how that is changing, and what we might want it to become.

[From the YAPC::NA Blog.]

Announcing Alien::GSL 0.03_04 plus some Module::Build questions

Hello everyone,

This note is to announce that Alien::GSL dev release 0.03_04 has be uploaded to CPAN and should be available shortly.

After lots of good feedback from Rob (Sisyphus) and learning lots about the warts in Module::Build, I think I have a more robust system in place now.

New features include:

  • smarter warnings for missing configure_requires dependencies
  • parse gsl.pc to get up-to-date compiler flag, no longer depends on hard coding things like -lgsl
  • rewrite gsl.pc before installing to provide correct paths relative to share_dir location
  • new gsl_pkgconfig_location function provides the path to the folder containing the rewritten gsl.pc file
  • includes gsl-config.pl which should behave like gsl-config but relies on Alien::GSL and its notion of the GSL libraries (this still considered work-in-progess)
  • more tests!! (required adding the ability to hook into $Alien::GSL::share_dir, since tests happen before install, and thus before placement into the location that File::ShareDir expects)

Some notes on Module::Build:

RIP John McCarthy

What a sad month.

I often forget how young the field of computing is. Computers are everywhere and it is difficult to imagine a world without them.

Computers, embedded in robotic machinery or general are so darn useful.

X They replace the calendar with a more lively one.
X They help you communicate and make new friends.
X They take down all your notes.
X They help the shopkeeper with his inventory.
X They help the doctors, take readings of the patient.
X They help a startup visualize latest trends.
X They assemble metal things with perfect accuracy to create a Ferrari.
X They help the musicians with their beats.
X They help the painter undo.
X They preserve history.
X They help the architect.
X They book your flights.
X They track your packages.
X They bring limitless information and possibilities to the bedside of every dreamer.
X They helped the thief's in ocean's 11.

What follows is an incoherent babble.

How do newbies find Perl learning materials online?

This is a very short entry, which will lead to a long one later. Right now in light of the recent hubbub about the study claiming that perl's as good as a randomized language for newbies, i am trying to find out just how a newbie searches for Perl learning materials online and what he finds first.

Right now i'm concentrating on what kind of search term a newbie would enter in Google. Luckily Google trends help a bit there, allowing me to compare between various search terms.

These are the search terms i came up with or was suggested:

perl tutorial 1.00    perl cgi 0.79    programming perl 0.45    perl examples 0.37    perl learn 0.10

perl_compare_2.png

Please help me and see if you can think of any other search terms that would be more often used than "perl tutorial". Thanks in advance.

Intro to Dancer

Mark Allen will give a talk at YAPC::NA 2012 he describes as:

This talk presents the Dancer web framework beginning with “Hello World” and progressing through a couple of easy to digest introductory applications.  All of the primary Dancer features are presented including URL routing, writing handlers, and output templating.  A selection of useful and common Dancer plugins will also be covered.  This talk is best suited for beginning and intermediate Perl programmers.

[From the YAPC::NA Blog.]

Introducing Text::sprintfn

Hitting CPAN mirrors as we speak (metacpan link).

Just my approach of doing string formatting that supports named parameter. Instead of creating a new formatter (with a new/different syntax), I just extend sprintf a bit:

sprintfn "%d %(num)d %d", {num=>1}, 2, 3; # prints 2 1 3

Named parameter can also be used in the width and precision field:

sprintfn "%(num)(width).(prec)f", {num=>1, width=>1, prec=>4}; # prints 1.0000

Compared to other modules, this one supports all Perl's sprintf() formats (since it's just sprintf under the hood) and allows mixing of named and positional parameters.

The current implementation is a bit naive, but it'll do for now.

DBD::SQLite 1.35 release planned for 22nd of November

It's been a fairly quiet year for DBD::SQLite, but largely in a positive sense.

The release rate and delta of SQLite itself has been fairly tame, and in Perl land we've seen a significant reduction in the severity of bugs compared to 2010.

Because of the significance of DBD::SQLite and the need for extended testing periods, it has been my policy to allow smaller fixes to accumulate without doing a release and to release DBD::SQLite in line with SQLite releases that recommend upgrading.

The recent 3.7.8 release of SQLite does not come with an upgrade recommendation for our current SQLite version, but does suggest upgrading as optional. This release contains some significant index performance improvements (described as "orders of magnitude faster") for large CREATE INDEX commands, and DISTINCT, ORDER BY and GROUP BY
statements are now faster in all cases.

The 3.7.8 release also contains some changes to make SQLite play nicer with Windows anti-virus programs.

perlanalyst approaching ...

Last week I went to my first Perl workshop: 13. Deutscher Perl-Workshop. It has been a great experience – great talks and even greater people.

On the train to and from Frankfurt and at the workshop itself I hacked a bit on my pet project: the Perl Analyst. The goal is to build a PPI-based tool that parses your Perl documents, it may then answer your questions about your sources. The tool and the modules it consists of may also lead to refactoring tools.

There is a running prototype on github which may reach CPAN soon. Currently you may use it to search for declaration of subroutines and lexical variables as well as the use of strings. You may search for them by exact matches or regular expressions.

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.