Announce: Data::Session - the complete rewrite of CGI::Session

Hi Folks

I've uploaded Data::Session V 1.00 to CPAN. See:
Data::Session

Please test it, especially the components I haven't:
o ODBC
o Oracle
o Passing the expiry time via Cache::Memcached to memcached

There is a section in the docs about Test Code.

Email me if you wish. My email address is at the bottom of:
Home page

Perl's "readability"

You know, when I look at Russian Cyrillic, or Greek letters, it looks like squiggles. I've never studied it, so I have no means to relate it to sounds, let alone meanings.

So, when people say, "I can't read Perl", it only tells me they haven't studied it.

And if people choose to be vocal about their own ignorance, saying "Perl is unreadable!", that's saying a lot more about them than it does about Perl.

As far as I can tell, millions of people speak Greek and Russian. I'm not one of them, and that's ok. I don't keep saying "Russian is impossible", simply because I personally don't know it.

If it matters, I've seen some pretty impenetrable Python, Ruby, and Java code. And I even pretend to know those languages at least in passing.

Workflow, part 3

I presented OOP approach for solving workflow tasks in my previous post. Now I'd like to show you, how to deal with workflows in a slight different manner. I'm gonna write about Workflow lbrary from CPAN. And I'm going to present you some kind of a tutorial on how to use this lib, and what features does it have.
The main idea of Workflow lib is configuration over coding. Flow is described in XML files, of course 'some' coding is still required.
So let's implement our request management using workflow lib. First of all, we'll create application, with all that simplifications, that we had in previous post, and than enhance it to real world web application and add some complex and interesting features that workflow lib can offer.

The rate of CPAN churn

I have a minicpan on my laptop in my home directory. My home directory gets included in my backups. This means that by looking at my old backups, I can get a good idea of how much the CPAN changes ...

snapshots $ du -sch */.../laptop-home-dir/minicpan 1.5G daily.0/.../laptop-home-dir/minicpan ... 145M monthly.0/.../laptop-home-dir/minicpan 127M monthly.1/.../laptop-home-dir/minicpan 127M monthly.2/.../laptop-home-dir/minicpan 120M monthly.3/.../laptop-home-dir/minicpan 111M monthly.4/.../laptop-home-dir/minicpan 137M monthly.5/.../laptop-home-dir/minicpan ...

daily.0 is my most recent backup, and monthly.0 through to monthly.5 are backups from 1 month ago up to 6 months ago.  We can see that the rate of change on the CPAN is fairly constant.  It's also surprisingly high, with almost 10% of the "active" part of the CPAN (that is, the bits that you can trivially access by typing "cpan Some::Module" to install, changing every month.

Yes, I realise that this is a gross simplification.

Blocked on debugger syntax highlighting

In my last post I mentioned my attempt to provide syntax highlighting for the Perl debugger. It works and I think it's useful, but I did that by hacking directly on the debugger. Every version of Perl gets a slightly newer version of perl5db.pl (the debugger) shipped with it and hacking on a particular version doesn't help¹. Thus, I need to write a separate module which encapsulates my hack and (relatively) cleanly alters how the debugger operates.

I could do something stupid like try to override print or something like that, but it's fragile. Instead, I only want to highlight Perl code and I can do that by only highlighting the code in @DB::dbline. That's because if you know the debugger, you know this little tidbit:

The array @{$main::{'_<'.$filename}} (aliased locally to @dbline via glob assignment) contains the text from $filename, with each element corresponding to a single line of $filename.

At this point, you may be wondering "what the hell is $main::{'_<'.$filename}?" Basically, the *::main{"_<$filename"} typeglob contains a lot of special information useful for the debugger. The array, scalar and hash slots are where the debugger has a lot of magic. Regrettably, this magic typeglob comes straight from the Perl internals and because of this, I have a problem.

New Ubic slides

Here are the slides from my recent talk at Moscow.pm meeting.
They are more detailed and hopefully less cryptic than my inital presentation.

Workflow and Perl, part 2

Let's make some code. (Check my previous post for flow chart).

Let's use quite simple straightforward approach, and then modify it with some design patterns.

General idea: We will have simple request object. (We wouldn't care how it's populated with data, let's assume that we have some collection object, that gathers requests from database and creates objects). Request will have following properties: id, description, state. We must be able to change states and perform some actions during that state changes.

I'm using v5.10 & Mouse.

Creating a task manager, stage the first, or: the itcy and scratchy show

So I decided to write a task manager.

I have recently tried to streamline my daily assignments in a task list, so I'll have track of stuff I do, or need to do. However, the way I work, I often find that a simple list does not suffice.

I would like a second level todo list that will collect several tasks that need to be accomplished before I can mark an item completed. Most of these are common for each job, but some are not. For instance, I want to tick off "merge from master before pushing" for every task, but "write POD" might not apply for pure-GUI (Template::Toolkit, HTML and JavaScript) jobs. Naturally, I want those to be available every time I add a task, and selecting from those should be as simple as possible.

Sadly, I found that, for all the plethora of solutions available, none gives me what I actually need.

Not A Post

This is not a perl blog post... Unfortunately I have not posted for a good while, and theres going to be a further gap before I start again properly.

So, following a week of holiday, a week on an intensive training course, a week running a theatre show and two weeks organising things for pantomime; I am about to start 2 weeks of pantomime stage management.

So basically I am not going to do much more in terms of blogging until late December.

Syntax highlighting for the Perl debugger

It's a nasty local hack and, sadly, I haven't found a way to generalize it. You can click on the picture for a larger image.

Perl Debugger with Syntax Highlighting

If you find this interesting/useful, let me know and I'll see if I can make this releasable.

Workflow and Perl, part 1

I'd like to start series of posts related to workflow, workflow management systems and of course Perl. Workflows seems to be quite “hot” topic in all that world of enterprise software for the last ~5 years.

First, let's figure out what workflow is, why we should care and how Perl can deal with it.

What is workflow?
Sample Workflow

A workflow is just a bunch of states with rules on how to move between them. These are known as transitions and are triggered by some sort of event. A state is just a description of object properties.

A workflow application is a software application which automates, at least to some degree, a process or processes. The processes are usually business-related, but it may be any process that requires a series of steps that can be automated via software. Some steps of the process may require human intervention, such as an approval or the development of custom text, but functions that can be automated should be handled by the application.

Final Perl Survey Grant Report

The final report for the Perl Survey is now available, after many delays. The report is fairly bare bones, but it should be sufficient for you to get a handle on the structure of the Perl community (or at least the sample who responded to the survey). I've gone for the approach that I'm presenting salient findings, rather than overwhelming you with detail.

There is a lot of data summarised in this report, and rather than producing a long turgid document with every possible analysis that I can think of, I thought that the better way to approach things would be to make a fairly short summary report so that people can ask questions, or request any additional information via the comments here, by email, or by grabbing me (kd) on irc.perl.org.

The October that will never be

There's a thread on the Israeli Perl mailing list regarding "What don't you like in Perl". There are the usual answers (Perl thread model is a disaster, Perl OO model does not go well with scotch etc.), but the real answer is only revealed on another thread, where a guy who made the unfortunate mistake of replying personally is getting berated for three or four paragraphs, before is also accused of "Top-posting".

Now, for the record, netiquette was invented by a bunch of nerdy snobs who really wanted something to use when explaining why others are not worthy of their time. The less people obey them, the faster we can get to a point where corporations are willing to listen to what "geeks" have to offer, since every time an "Enterprise" guy is looking in a Perl mailing list, all they see are bunch of petty "you do not follow rule 23 of how I want the world to act".

It's also hard to explain the benefit of the "Unix culture" to anyone who just was told to "RTFM means read the FUCKING manual, FUCKER" on #DBIx-Class. It's even harder when said someone is the owner of the leading Perl/Catalyst company.
OTOH, DHH is also known to be an F-bomb terrorist so maybe it's a prerequisite or something.

Now With Go-Faster Stripes

If you've ever had a look at the Status page on the CPAN Testers Reports site, you will likely have noticed that typically the graphs show 4-5 lines on any given day. This has been pretty much the case since I added this monitoring feature, and supported the fact that it could take up to 5 days for a less common page to be rebuilt.

However, over the last 2 weeks that has been changing, to the point that from about 4pm CET yesterday (24/11/2010) the builder only had requests less than 24 hours old. It appears there are three reasons for this.

The first is that we have seen a reduction in report submissions over the past few weeks. Having said that, the submissions during October was rather substantial, topping over 500,000 submissions, so it's not too surprising to see a reduction. And to be fair looking at the Monthly Stats, we have already had over 300,000 report submissions this month, so it's not been a quiet month either.

CatatlystX::ListFramework::Builder finally removed from CPAN

This note is to announce that I've just now, finally, removed the old CatalystX::ListFramework::Builder distributions from CPAN. Don't worry, the module has long been deprecated in favour of its more popular replacement Catalyst::Plugin::AutoCRUD.

This moment cannot pass without thanking Andrew Payne and Peter Edwards for creating the ancestor to them both, CatalystX::ListFramework. I believe Peter had the thought to provide some kind of simple web access to database tables, and prodded Andrew into creating the ListFramework. Whilst out at a miltonkeynes.pm meet one evening, I discussed forking the code to make it more automagical and to allow the use of an AJAX UI which Peter had good reason for not wanting at the time. And so ::Builder was born.

I'm looking forward to the future of ::AutoCRUD. More time is available to me since I changed job recently, and there is a bunch of ideas waiting in the queue. If you have suggestions for AutoCRUD's wishlist, please do create a simple RT ticket against the module.

Where Have You Been All My Life?

I've only known you for a few months defined-or but if you leave me know you'll take away the biggest part of me.

State vars, lexical $_, smart matching and switch statements are all wonderful as well.

A big thank-you to all you perl 5.1x contributors out there.

Grantreport - Perl 6 Tablets - third week

Remember what I wrote in my first 2 reports? "tablet 2 is finished." And I still had to add something. And also the Perl 6 trends doubled in size since i first wrote: ready !! :) If you really wonder what Perl 6 is about here you have all the thoughtwork in a few lines.

The index has now 577 entries (many rewritten). contextualizer table overhauled and
Tablet 3
is nearly half ready. But much more important: all the usable parts are now up to date. It was all in all 70-80 edits which start to annoy the #perl6 people. #sorear++ was so kind to add the wiki URL to what dalek (a #perl 6 chatbot) watches. This makes all my changes visible to the core people and lurkers. Not to collect karma (buddha says also good karma binds you - freedom means no karma) but to integrate and maybe raise awareness so that maybe other contribute. After all we need good docs that are easy to read and navigate. it would help much more when daleks messages would report what I currently changed, but since socialwiki doesnt do good difs nor support change subjects for the author to fill in, we have an semioptimal solution. i want to have this wiki updated/replaced anyway. any help ???


BTW:
im really proud of...

"Money spines paper lung..."

"...kidney bingos organ fun"

Congratulations to BinGOs, aka Chris Williams, on reaching 3 million test reports submitted. Chris alone now accounts for slightly under one third of all the test reports submitted to CPAN Testers!

Since joining the CPAN Testers community, Chris has been a valuable asset, both in terms of the diversity of the testing platforms, and also for his ability to push the testing infrastructure beyond the limits we anticipated.

With the stagnation of the CPAN-YACSmoke distribution, Chris eagerly stripped it down and rebuilt it into CPANPLUS-YACSmoke, providing a stable basis for testing with CPANPLUS once again. Since then Chris has expanded his knowledge of distributed testing, and developed more applications and modules to support various styles of smoke testing, from his POE plugins to smokebrew.

Well done Chris, and here's to the next 3 million!

Cross-posted from the CPAN Testers Blog

Perl, Thread and shared scalar example

This is a simple code that show an example about use thread::shared to share a variable in thread context.

Two RegExp bugs in Internet Explorer 8

It turns out there are at least two bugs in IE 8's Javascript regex engine. One of them is widely known, the other one doesn't seem to be.

Testcase: /^(?:(?=(.))a|(?=(.))b|(?=(.))c)/.exec('bar')
Correct result: ['b', undefined, 'b', undefined]
Actual result: ['b', 'b', 'b', '']

The last '' is the known bug: capturing groups that don't participate in a successful match are set to '' instead of undefined. Slightly annoying, but not too bad.

But the 'b' at index 1 is just wrong: The first capturing group was entered, but that branch failed (because the target string didn't start with an 'a'). At this point all captures from this branch should have been reset to their previous state (in this case undefined (or '' for IE)). That didn't happen.

End result: we get a successful match, but the captured strings may have completely bogus values.

I think this is pretty funny because I once wrote a toy "regex engine" when I didn't really know anything about bytecode or automata or anything. It used "brute force" backtracking based on recursive function calls (no explicit stack). Well, it had that exact bug ... until I noticed and fixed it a few months later. In other words, this is a beginner's mistake in state management/backtracking.

I'm pretty sure Microsoft does some testing before it releases software. Didn't anyone notice this?

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.