Catalyst::Plugin::Session::PSGI - minimal configuration access to PSGI/Plack session

This is a module I wrote a few weeks ago and intended to share sooner for feedback, suggestions and guidance.

The module was born out of my discovery that although there’s PSGI support in recent versions of Catalyst the session’s are discrete entities. As I was experimenting with mounting multiple PSGI apps, pretending to be one, I didn’t want to have to manage multiple sessions, or worst still, keep multiple session configurations in sync.

The initial release, documented below, does work in the cases that are relevant to me. I’m concerned that I’ve abused some methods or taken some bad design choices to solve the problem as I percieve it. I’m worried that there are sharp edges and stupid bugs in places I simply haven’t considered yet.

I’m always happy to receive feedback, constructive criticism and patches on my modules and I’d really like to get some feedback, better solutions and tests so that I feel more comfortable dropping the experimental warning in the future.

the "how much you can handle?"-tour 2011

Yes lichtkind moves around the continent. Dates are 16-18 Aug in Riga, 8-9 Okt Turin, 19-21 Okt Frankfurt and 4-5 Nov in Vienna and Bratislava. Which stands out for me is that I will have given then at least 11 talks (4 different) + 3 lighting (always the same) spanning 5 1/4 hours. I really wanted know where are my limits and how far my skills in talk preparation go.

And as a surprise I found, start very early with you preparation. I mean by that that you can still hack together your slides or storyline quickly together. that is fine. But start you research, your search for sources, quotes and knowledge very early. that doesn't work well under time preassure. As soon you found something worthwhile, write it down. Organize your knowledge: loosely but searchable. having something so say that fits the situation with the attendees and recent discussion is the most important thing i believe. you have to live with the topic for a time and see it from different angles. talk with people about it. no matter how good you are, theres always something to learn even its just what others interests about that subject.

btw, same is true about writing docs, but wait, ... that is the content of one of the talks. later ... :)

Subtle advantage of @_ ?

It eliminates method polymorphism.
Makes it simple for over-riding inherited method, as there is only one method.
Now that makes Liskov Substituion simpler to implement.

Tied Variables: One more reason to love Perl

As many of you know, tied variables lend extra magic to an otherwise normal Perl variable.

One of my favorites comes from File::chdir. This provides your Perl script with $CWD and @CWD. When a folder is assigned to $CWD or pushed onto @CWD the working directory is changed, in a platform independent way. The coolest thing about this is if you first local $CWD, then this change in the working directory is done locally to the block, and is undone as the scope ends.

I just released version 0.03 of Tie::Array::CSV. This module allows accessing a CSV file (or other separator parsable by Text::CSV), using a Perl array.

Underneath the hood there is more tie magic! Tie::Array::CSV uses Tie::File which provides random line access to a file as a Perl array. Using this module in mine allows the module to pick the row just like my users will, as an array index.

Version 0.03 adds a new constructor. So that the users don’t even need to be aware of the tie usage, which looks a little strange at first.

As far as I am aware, other languages don’t have anything like tie. Just one more reason to love Perl! Which other Tie classes do you find especially interesting?

Simple config for the perl debugger

I’ve been using a config file ($HOME/.perldb) for some time now. While it’s not the biggest file in the world it automates settings that I’m far too lazy to type every time I fire the beast up.

.perldb

$DB::deep=1000 ;
sub afterinit { push @DB::typeahead, "{{v" unless $DB::already_curly_curly_v++; } ;
parse_options('dumpDepth=2 NonStop=1') ;

The Explanation

$DB::deep=1000

This increases the limit for the recursion limit from 100 - a level that’s so low I seemed to be hitting it all the time

sub afterinit { … }

I like ’v’ as a way of seeing where I’m at in the code, with some context. I hate typing it myself every time the debugger returns to the prompt.

This small piece of voodoo simply pushes the command ’{{v’ onto the list of things to do when the debugger has finished initialising. ’{{’ is “Add to the list of debugger commands to run before each prompt” and ’v’ is “View window around line”.

Until recently the command was just

sub afterinit { push @DB::typeahead, "{{v" } ;

YAPCs, Perl workshops and Monger meetings

As I was trying to buy my flight ticket to the London Perl Workshop I thought I look around if there is some other interesting event on the days before or after. Quickly I landed on Eventbrite and found a couple of interesting talks at The RSA.

As I was already at Eventbrite I checked which Perl events are listed there.
To my surprise there are almost no Perl events listed on Eventbrite.

Maybe if there was a Perl Module for Eventbrite?

Then I checked Grical for Perl, Lanyrd, Joind In, Upcoming of Yahoo and ...

nothing.

Well almost nothing.

The only place where I saw the London Perl Workshop was the Lanyrd web site and there was only one other Perl event there.

So are we surprised people don't see us?

I don't know how big the impact could be but what if all the YAPC and Perl Workshop organizers started to post their events on these sites? Could that help in getting more attention?

What if each Perl Monger meeting was posted there?

What if someone implemented the modules to access the above web sites?

What if someone wrote a script that could be used by all the organizers to update the various event sites?


Written by Gabor Szabo .

Perl module ideas #1

Below are some of module ideas that I think will be useful someday, but since it's not urgent now, I'm sparing my tuits elsewhere. There will be future posts.

* A module to detect the software of a forum (e.g. vBulletin, phpBB3, etc) and provide some basic API that works for all supported software, e.g.to retrieve threads and posts, open a new topic, reply to a topic, mark topics read, etc.

* Likewise for blog software.

* A module to detect {Yahoo Messenger IDs, Blackberry PIN numbers, street addresses, other contacts} from a text. I have written one for Indonesian phone number, but the others might be useful to extract information from text.

* Something like App::perlmv for MP3 tags.

* App::IniUtils: Command-line utilities to modify INI files, e.g. (ini-add-param, ini-delete-section, ini-sort, ini-comment).

* DOM for Org::Parser.

So many ideas, so little time.

German Perl Workshop day 2

Today, we had more talks than yesterday. Marc Chantreux talked about his module, 'Perlude', an interesting CPAN module porting some of Haskel's ideas to perl.

Gerhard Schwanz presenting Mapweaver was the next speaker, directly followed by Denis Banovic presenting the simplicity of Dancer. For me, this talk was the best of today.

Steffen Ulrich gave an excellent introduction into TLS and explained some recently happening issues and how they could occur.

As a replacement for an omitted talk, Heiner Kuhlmann presented a tool to display some software quality metric values graphically. Nice to see Perl-Critic in colored boxes :-)

Herbert Breunung talked about some features of Perl 6. Whenever I hear him talking, I wish Perl 6 was already production-ready. All the new features are really awesome!

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 run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.