Ouch - Exceptions that don't hurt.

For the past many years I've been using Exception::Class to create rich, object-oriented exceptions. However, I've always disliked it, but I never found anything better. I felt like it was just too verbose and seemed to get in my way more often than it helped. Finally I created Ouch, a minimalist exception handling system. Details after the jump.

Can we afford bad code on blogs.perl.org?

If you have a regular look on blogs.perl.org, you will have noticed a certain newcomer around here who keeps posting uncommented Perl scripts. I don't mind a noob asking stupid questions. Heck, I don't even think that noobs can ask stupid questions. But can the Perl community afford to have really bad code on a domain named 'perl.org'?

Just asking.

perlnews bot renewal

I have recently replaced my perl news bot for IRC (#news@irc.perl.org) and Twitter (@perlnews) along with the server where it resides. Now it is powered by AnyEvent (it was a Plagger bot before), and its repository goes to github as well. If you find anything wrong or if you have any feeds to be included, send me a pull request. Enjoy.

https://github.com/charsbar/perlnews

2011 Perl QA Hackathon

So the 2011 Perl QA Hackathon is happening here in Amsterdam and sponsored in part by my employer, Booking.com (what? You want to sit by a canal here in Amsterdam, eating bitterballen, drinking Grolsch and loving life as an expat? Drop me a line because we're still hiring). This will give me a chance to catch up on a fair amount of code I've been neglecting (testing related and otherwise). Of course, I think I have a damned good excuse for not being as "present" in the community as I otherwise could be the last couple of months:

Our beautiful daughter

That being said, I still want to apply some long-neglected patches to Test::Differences and other modules.

I also have a few other ideas up my sleeve, but we'll see how much time we have.

Quick Start : Puppet

This is mostly a note to myself in case I ever need to do this again. I’ve already got a git managed puppet config and need to remember how to deploy it on a new server.

Pre-Requisites

  • Debian based server (Debian, Ubuntu)
  • git repo for existing /etc/puppet
    • if you don’t have an existing repo, you can turn the default /etc/puppet into one later

On your server

You’ll need to install the tools and your configuration:

Installing Puppet Master

sudo aptitude install puppetmaster vim-puppet

Install git managed puppet repo

Don’t forget to change the repo name where necessary!

sudo mv /etc/puppet.default/ /etc/puppet
sudo mv /etc/puppet/ /etc/puppet.default/
git clone git@github.com:chiselwright/puppet-chizography.git puppet
sudo mv puppet /etc/
sudo /etc/init.d/puppetmaster start

Creating a new puppet config repo

I love it when a plan comes together

Barbie blogged about the 11 million test reports mark, and gave a link to a dataset.

I had been sitting on my data "visualization" idea App::ffeedflotr for some time already, and had just started writing and publishing it on github. That dataset pushed me to write a short tutorial / showcase of the application.

The screenshots were produced by WWW::Mechanize::Firefox, the charts produced by the flot library, and the Javascript manipulation also came through MozRepl::RemoteObject. It's nice when your tools conspire to surprise you in a good way!

11 Million Test Reports

It seems I wasn't paying attention to the CPAN Testers Statistics site when writing the March Summary. A little over 11 weeks after our last milestone, on 11th March we pass the 11 millionth report, as can be seen on the Interesting Stats page. As always, many thanks to all the testers who have help to contribute to this milestone.

Congratulations to Andreas J. König for posting the 11 millionth report. It was a PASS for Parse-ErrorString-Perl-0.15.

Cross-posted from the CPAN Testers Blog.

Bovicide 5: Parse-time Error Reporting

This post is one of a series prompted by an exchange of papers on the Internet. That exchange discussed what it would take to produce an acceptable replacement for yacc and the entire family of LALR-based parsers.

My first post concentrated on speed and power -- the ability to parse all context-free grammars in O(n**3) time, and the ability to parse just about every grammar in practical use, including all yacc-able grammars, in linear (O(n)) time. This is the second of two posts about error reporting.

Error reporting is often ignored, but it is extremely important. In a previous post, I suggested that its poor error reporting properties are the real reason why production parsers are abandoning the once-dominant LALR in favor of hand-written recursive descent. LALR's feedback on grammar errors could pass for low-grade encryption.

Yet Another Perl Podcast #3: Анонс

Анонс выпуска №1
Perl программист, CPAN-автор, один из разработчиков популярного web framework’а Mojolicious, организатор локального Perl-сообщества Ростова-на-Дону - RostovOnDon.pm, человек который живет по принципу: “use Perl or die;” - Анатолий Шарифулин в гостях у Yet Another Perl Podcast.
Свои вопросы Вы можете писать в twitter: twitter.com/yapp_ru, по почте: yapp_ru@gmail.com, в jabber: yapp@demond.org или в комментариях к данному анонсу на blogs.perl.org по адресу: https://blogs.perl.org/users/perl_demon/

App-ffeedflotr - plot using Firefox and flot

Sometimes, I want a pretty plot of data. Excel is not always the tool of choice,
especially when the data to plot is something like running progress of a (Perl) script I wrote,
or the output of

while /bin/true done; ls $file ; sleep 1; done

Inspired by feedGnuplot , I wrote ffeedflotr.pl, which takes data and plots it in Firefox. So far, it is not really configurable. But as I have the API blueprint of `feedGnuplot`, I can easily/conveniently adapt it to the featureset.

One nasty thing I found is that Firefox does not like to execute Javascript that comes from `data:` URIs. I suspect this is due to security concerns, but it means that I have to find a sneakier way to load custom HTML into Firefox, preferrably avoiding a tempfile. Things that I've tried so far are named pipes - Firefox does not like reading from these either, likely due to the same or similar security concerns.

Adding Version Control Sanity to Solaris logadm

Solaris includes a log rolling utility called logadm, which is very useful for managing logs without having to write your own custom scripts or install some other utility across all of your servers.

However, there is one big drawback to logadm. Whenever it runs, it stores a timestamp for each log it rolls in the logadm configuration file itself. I'll leave it to the reader to question the sanity of this.

For example:

/var/adm/messages -C 4 -a 'kill -HUP `cat /var/run/syslog.pid`'

Is changed to:

/var/adm/messages -C 4 -P 'Sat Apr 09 21:27:21 2011' -a 'kill -HUP `cat /var/run/syslog.pid`'

Stop using Locale::Maketext

The following is a translation of a talk given by Steffen Winkler at German Perl Workshop 10, Internationalisierungs-Framework auswählen, in 2010. You can find my translation of the POD on Github. (In fact you are better off reading it there, because the CSS formatting on blogs.perl.org sucks, at least for now. If you’re seeing this in a feed reader, feel free to stay.)

Aside from Steffen’s talk, there is also Nikolai Prokoschenko’s rant On the state of i18n in Perl, which mentions to some extent the fact that gettext has established workflows as well as supporting software (such as graphical tools) known in many software communities and even outside the open source world, whereas Maketext has… none of that, and is known only to Perl folk.

Be smart. Don’t use Maketext.

Yet Another Perl Podcast #2: Новости за прошедший месяц, источники информации на русском, новые cpan модули

События за прошедший месяц ( март - 1.03.11-1.04.11 ): Релизы cpan модулей: Источники информации о perl:
  • planetperl.ru - аггрегатор новостей про perl
  • onperl.ru - блог Андрея Шитова
  • perlrussia.org - расписание мероприятий
  • perl5doc.ru - переводы документация perl5 на русский язык
  • pm.org - Perl Mongers
  • moscow.pm.org - московская группа perl программистов
  • kiev.pm.org - киевская группа perl программистов

В выпуске участвовал

Cсылки: RSS и лента на rpod.ru
Следите за анонсами в twitter

Funky Function Filters in Perl6

A while back I wrote about Funky Function Filters. Let me refresh your memory - we have a Python and a Ruby snippet and we translate it into Perl5. The code is a toy to show some fancy shmancy lambda (unnamed functions) usage. The idea is to take a list of functions, filter them, and then with the remaining ones show what happens with parameters from -10 to 10.

Python example:

for f in filter(lambda f: f(-1)>=f(1),
                [lambda x:x, lambda x:x**2, lambda x:x**3]):
    for x in range(-10, 11):
        print x, f(x)

Ruby translation:

for f in [lambda { |x| x }, lambda { |x| x**2 }, lambda { |x| x**3 }
         ].select { |f| f.call(-1) >= f.call(1) }
    for x in -10..10
        print x, f.call(x)
    end
end

My perl5 translation:

CPAN Testers Summary - March 2011 - Hourglass

A relatively quiet month during March, although my thanks go to Leo Lapworth and Dave Cantrell for noticing and reporting bugs in the websites. Feel feel to report bugs you spot on the CPAN Testers websites to me directly (barbie@cpan.org), as if I'm not the person to deal with that particular website, I can re-direct you to the right person. You're also welcome to report bugs on RT, and as I get more of the individual websites on CPAN, it'll be easier to report bugs and feature requests directly for the respective website.

Work has been ongoing with releasing the website code, with the release of CPAN-Testers-WWW-Wiki, which contains the basic code to run the CPAN Testers Wiki. The data that is contained within the website has not been released, though it is available on request if anyone wished to use it. I'm currently working on packaging the CPAN Testers Blog in the same way, and hope to have that released later this month.

First steps with App::Mist

My last posting seems to have whet the appetite of a few people, or at least interested one or two enough to follow this project on GitHub. Today I'd like to delve deeper into how you can use App::Mist to deploy or distribute an application.

Slides from my presentation at OSDC.TW 2011

I gave a talk at OSDC.TW 2011 about PPM as yet another faster installer, and several modules I took over from Randy Kobes who passed away last year.

Compared to the transition from CPAN/CPANPLUS to App::cpanminus, PPM, which once used a remote API server but now downloads indices (summary) and store them in a local database, seems to be taking a different (or opposite) track. Its XML based spec is apparently old-fashioned (actually, the original Open Source Description spec, on which PPM spec was based, was deprecated years ago). And the one on the CPAN is way behind the one bundled in ActivePerl. Certainly it's not good for everyone.

Excel::Writer::XLSX with charts

I've released a new version of Excel::Writer::XLSX to CPAN with support for charts.

The output looks something like this:

column1.jpg

The example program that generated it is here.

I'll be adding more features in the near future such as chart sub-types, formatting, hi-lo bars and droplines.

If you are already using the Spreadsheet::WriteExcel charting features, or are interested in using this feature, try it out and let me know what you think.

The osCommerce shopping cart morphs into Perl

Hi Folks

I'm beginning to transform a major part (but not all) of the osCommerce shopping cart into Perl. See osCommerce for details.

If you've already done so, and your code is open source, let us all know. Otherwise, I'll just keep grinding away, given that I've got the time and incentive to do so.

The namespace I intend to release it under is Business::Cart::Generic, and I'll be releasing another, restricted, version as Business::Cart::EdgarsMission.

The latter is an animal rescue group here in Victoria (Australia), who I've volunteered to help with their problem of charging people more-or-less accurate postage when they buy merchandise from Edgar's Merchandise.

The problem comes from being able to stuff 2 T-shirts, say, into 1 parcel, and thus not being able to justify postage on 2 separate T-shirts.

Basically, I'll keep track of purchases and with the aid of a special table of information (i.e. rules of thumb) from the chief packer of merchandise, I'll determine which sized package can be used for all the common combinations of merchandise.

Naturally this system will not be exact, but they are prepared for that.

I volunteered thru Good Company.

Compile a Vanilla Perl on Windows with MinGW


Compiling Perl on Unix is really straight forward, but on Windows you need to pay some extra effort .

If you want to build a default (a.k.a. Vanilla) Perl distribution on Windows with no pain read the following concise article:

http://perl-node-interface.blogspot.com/2011/04/compile-vanilla-perl-on-windows-with.html

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.