Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Yanick (3196)

  (email not shown publicly)

Journal of Yanick (3196)

Saturday December 09, 2006
05:09 PM


A few weeks ago, while I was doing one of those activities that allow the mind to disconnect and roam of its own (could have been while I was showering, or riding the bus, or attending a team meeting, I don't recall), an idea hit me. The game Monopoly has variations themed on everything under the sun, from countries (Canada-o-poly, eh!), to TV programs (the Simpsons), to pets (Cat-o-poly), to God-knows-what. So why not do a Perl-themed variation of it?

  • The currency of the game wouldn't be dollars, but lines of code (LoC).
  • The properties would be modules, to which you assign code monkeys and gurus. The different module groups could be:

              Embperl HTML::Mason

              Acme::Bleach Acme::EyeDrops Acme::Buffy

              Email::Filter Mail::SendEasy::SMTP Mail::Box

              Net::Telnet Net::FTP Net::SSH

              DBD::SQLite DBD::MySQL DBD::Pg

              PerlQt Wx Gtk

              XML::LibXML XML::XPath XML::Twig

              Module::Build ExtUtils::MakeMaker

  • The utilities would be 'perldoc' and 'perlbug'.
  • You wouldn't go to Prison, but would 'use Safe;'
  • Instead of Chance, we'd have rand().
  • Community chest? Surely you mean comp.lang.perl.misc.
  • Free Parking would be replaced by YAPC.
  • Railway stations would be replaced by pragmas: strict, warnings, bytes and utf8
  • Etc, etc, etc.

The whole idea tickles enough my fancy that I might whip up an SVG rendering of the board one of those days.

Sunday October 22, 2006
04:42 PM

PerlWar 0.02 is out

note: this message was originaly sent to the PerlWar mailing list (

Almost on the anniversary day of the initial release of PerlWar, I'm happy to announce that I (finally) stamped and released PerlWar 0.02 (now in transit toward your nearest CPAN mirror).

Although the innards of the game engine have been massively rewritten, the look'n'feel of the game itself has remain mostly the same. The new elements a player might care about are:

  • Agents have access to three new variables: $O, the player owning the agent, @o, the list of players agents pretend to belong to, and $o, the modifiable facade of the current agent.
  • The Blitzkrieg variant (in which players only submit an agent on the first turn) is now implemented.
  • The roster of a game can be predefined (as it was the case before), or it can be declared 'ad-hoc', in which case any player registered to a master file can automatically join a not-started-yet game by simply submitting an agent.

To kick the tires, I've created a new ad-hoc, Blitzkrieg game at The game will be run this Friday (Oct 27th) at roughly 8:00pm EST. Everybody who wish to participate is welcome. For whoever was in the last game, I've migrated the names and password to the new player master list. If you weren't there or have forgotten your password (which would be small wonder, considering that it's been over a year), just poke me and I'll do all the appropriate magic.

Wednesday September 20, 2006
11:25 AM offline journal editing

I must admit that I find the journal editing page of a wee bit irksome. First, there's the itsy bitsy editing box (I'm sure there's a configuration somewhere to increase its size, but I haven't found it yet). Then there is the HTML formatting that, in these days of wikiness, feels awfully verbose and clunky.

The first itch, admittedly, can be solved by using Firefox's plugin ViewSourceWith , which allow to edit textbox field in your editor of choice.

But the second itch remained. So I rolled up my hack sleeves and typetty-typed a script that takes in a journal entry in good ol' pod, converts it to SlasHTML (using Pod::Simple and a XML::XPathScript template) and then uploads the result to (using Slash::Client::Journal ).

The script can be found here . To have it work for you, grep for cookie_file in the code and change it the right value for you. pod2slash entry.pod prints the formatted entry to STDOUT, and pod2slash -p entry.pod publish it to

NOTE: for some reason the upload mechanism seems to choke when there are links. Darn, darn and triple darns.

Thursday September 14, 2006
01:50 PM

Embperl 2.0 chdir quirkiness

ah AH! It took me almost one year, but I finally got the sucker!

In the PerlWar web interface, I have this Embperl upload page. Except that ever since its conception, the little devil fails something like once every five times, without any visible reason.

Well, the reason, it turns out, is that Embperl 2 doesn't chdir to the page's directory (whereas Embperl 1 did). So if you're trying to open a file using a relative path, it'll work or not depending of the mood and state of the apache process the request is riding.

The solution? Add the following to the top of the page:

        $path = $epreq->component->cwd;
        chdir $path or die "couldn't chdir to $path: $!";

Wednesday September 13, 2006
12:15 PM

Gentlemen, set your keyboards to 'optimized'

Yesterday, I decided to put in action two of the neato keyboard layout optimization tricks that I got from the the vim tips rss feed.

optimization 1: ( $caps_lock, $esc ) = ( $esc, $caps_lock )

In vim, one hits ESC a gazillion time a day and CAPS LOCK maybe, on two or three times a century. Yet, the first key is located at the outside periphery of the keyboard while the second sits, fat and proud, in the middle of things. Not fair. Well, doing a xmodmap escapswapper fix that engineering blunder, where escapswapper is:

! Swap caps lock and escape
remove Lock = Caps_Lock
keysym Escape = Caps_Lock
keysym Caps_Lock = Escape
add Lock = Caps_Lock

optimization 2: y/123456789/!@#$%^&*()/

When one programs in Perl, one gets to type '$', '@' and '%' six times per line (or more, if you're a Perl golfer or swear a lot in your comments). In comparison, numbers are used a wee bit less frequently. And yet, it's the symbols that get the shift tax. Not fair. Again, a little remapping easily corrects this gross injustice:

in ~/.vimrc

autocmd FileType perl source ~/.vim/my/perl_map.vim

and in ~/.vim/my/perl_map.vim

" map each number to its shift-key character
inoremap 1 !
inoremap 2 @
inoremap 3 #
inoremap 4 $
inoremap 5 %
inoremap 6 ^
inoremap 7 &
inoremap 8 *
inoremap 9 (
inoremap 0 )
" and then the opposite
inoremap ! 1
inoremap @ 2
inoremap # 3
inoremap $ 4
inoremap % 5
inoremap ^ 6
inoremap & 7
inoremap * 8
inoremap ( 9
inoremap ) 0

Sunday September 03, 2006
11:02 AM

The Dahut Vinci Code

I'm afraid there is a dark and sinister conspiracy going on in the Perl underworld, and that I misadvertently stumbled in the middle of it...

I've heard rumors of it a few years back, but at the time I had discarded it as nonsense. I mean, who in his or her right mind would think something that big, that far-fetching, could be kept secret, and yet be true?

But yesterday, I've read the same information, typed straight from the fingertips of an undisputable source (which identity I of course wouldn't reveal, to keep him safe from harm):

Dahuts have their hands (err, hooves) in the AxKit project.

Yes. Dahuts. Those secretive animals decribed as half-llamas, half-yetis by both scholars of mythical lore and slightly tipsies sailors in bars.

Incensed by that discovery, I tried to access one of the thomes of knowledge on the subject. Namely: Acme::Dahut. But a critical, central piece of information has gone missing.

Website downtime, or the action of the Alpian Illuminati cabala trying to suppress information to leak out to the public? I don't know, but one thing is for sure: my great-great-grand-father's rusty yet thrusty musquet is loaded and ready shoot any albino monk who will happen to wander down my street...

Saturday September 02, 2006
09:00 AM

Perlwar: the long, hard road out of hibernation

This week, I got the poke that (I hope) will me nudge back into Perlwar development.

The first step: re-install the project's Trac environment and subversion access (they had been down since the great Summer Upgrade). I'm pleased to report it's been acheived without much ado or angst.

I was also displeased to discover that spammers got their grubby hands on the link leading to the former at some point and viciously spammed the wiki and the bug database. *sigh* On the plus side, I don't have to reach very far now to find links about porn, medications or baseball uniforms.


One a different topic, the Hypocritial Distortion of a Word that Really Gets my Goat award goes for this week to "Synergy". As in "the merger of our two companies will create synergies" when one means to say "the merger of our companies will allow us to lay off a ludicruous percentage of our workforce".

Tuesday August 29, 2006
08:11 PM

Reinstalled awstats on Babyl

Re-installed awstats on Babyl (a leftover task from the Great Reinstallation of Summer 2006).

Looking at its site I realized I'm still listed as one of the developers (I contributed a small snippet of code in the days of the Code Red worm). I should kick myself and see if I can't dive back into it one of these days.

On an unrelated note, someone poked me via email, asking if Perlwar is dead. Nope, it's just sleeping very, very deeply. That's another thing I have to dive back into. (*sigh* so many things to dive into, so few speedos...)

Thursday August 24, 2006
10:37 PM

Perlish theme for Friends, Fans and Foes

Today I discovered Stylish, a very cool Firefox plugin to create per domain/site/page CSS style. To test it, I decided to give a Perlish flair to the Friend/Fan/Foe icons on

@-moz-document domain("") {
img[alt="Friend"] {
   background: url( top left no-repeat !important;
   padding-top:16px !important;
   width:16px !important;
   height:0px !important;
img[alt="Friend of Friend"] {
   background: url( top left no-repeat !important;
   padding-top:16px !important;
   width:16px !important;
   height:0px !important;
img[alt="Fan"] {
   background: url( top left no-repeat !important;
   padding-top:16px !important;
   width:16px !important;
   height:0px !important;

img[alt="Foe"] {
   background: url( top left no-repeat !important;
   padding-top:16px !important;
   width:16px !important;
   height:0px !important;

img[alt="Neutral"] {
   background: url( top left no-repeat !important;
   padding-top:16px !important;
   width:16px !important;
   height:0px !important;

Here's a screenshot of the result.

Wednesday August 23, 2006
08:58 PM

Test::Pod::Snippets v0.01 is out!

From T::P::S's manpage:

Fact 1
In a perfect world, a module's full API should be covered by an extensive battery of testcases neatly tucked in the distribution's t directory. But then, in a perfect world each backyard would have a marshmallow tree and postmen would consider their duty to circle all the real good deals in pamphlets before stuffing them in your mailbox. Obviously, we're not living in a perfect world.
Fact 2
Typos and minor errors in module documentation. Let's face it: it happens to everyone. And while it's never the end of the world and is prone to rectify itself in time, it's always kind of embarassing. A little bit like electronic zits on prepubescent docs, if you will.

Test::Pod::Snippets's goal is to address those issues. Quite simply, it extracts verbatim text off pod documents -- which it assumes to be code snippets -- and generate test files out of them.


Test::Pod::Snippets: on its way to a CPAN near you. In the meantime, it can be peeked at in its svn repository or its web interface.