Skip navigation

This week I (re)started using Catalyst.

I used Catalyst for a project around 2003-4, and can’t really remember anything.

At the time I used Tangram as ORM, but now I’m starting with DBIx::Class (mainly because docs are using that and I want to get on coding without need to check the docs as fast as possible).

Today, after fiddling yesterday with models, controllers and views with mock-up data for a while to get around the idea of Catalyst’s MVC perlish implementation I started developing the real project and stumbled upon encodings.

As I live in Japan, the DB is encoded in Shift-JIS, and HTML content must also be served using that encoding.

I found C::P::Charsets::Japanese, but all it does is simply change the encode of the response (to whatever you set as “in” -code, views, etc-, and “out” encodings). But is not really optimal, since the DB data is “in”, and already in SJIS.

Simply feeding the views with the DB data turns it into garbage. And I usually have the templates in SJIS.

Maybe when I retrieve data I must create a recordset what encodes it to utf to use it internally?
And user POST/GET data must be also re-encoded?

Hmm…
still not sure what the right approach is.

While browsing through old files, I found an image advocating the use of the strict pragma in Perl. The file date (download date?) was on my birthday in 2005.

So there you go, another reason on why to use strict:

use strict;

Since wordpress starts with a Hello World sample page, I Perlified it accordingly.

perl -le 'print "Hello World"'

Nothing much to add by now.