kaare's Journal http://use.perl.org/~kaare/journal/ kaare's use Perl Journal en-us use Perl; is Copyright 1998-2006, Chris Nandor. Stories, comments, journals, and other submissions posted on use Perl; are Copyright their respective owners. 2012-01-25T02:39:33+00:00 pudge pudge@perl.org Technology hourly 1 1970-01-01T00:00+00:00 kaare's Journal http://use.perl.org/images/topics/useperl.gif http://use.perl.org/~kaare/journal/ Perl Mail Server http://use.perl.org/~kaare/journal/37771?from=rss <p>I installed qpsmtpd (journal entry http://use.perl.org/~kaare/journal/37631) a while ago. It is fun, you can mess with separate bits and pieces the usual Perl way, and qpsmtpd has a very low ressource consumption on the system.</p><p>So, just a thought. Why not implement a full-feature mail system in Perl? At least it would be nice to know if all the different mail server elements exist in Perl.</p><p>A quick look turns up rather mixed. Perl email modules mostly look dead, but so did Qpsmtpd until I started looking.</p><p>SMTP Server<br>Short answer: Qpsmtpd</p><p>Local delivery<br>You can manage your sieve scripts with Net::Sieve. Perhaps there could be a Qpsmtpd plugin for delivery using Sieve scripts.</p><p>MTA<br>I only found Tipjar::MTA. Doesn't support ESMTP according to the POD. Doesn't seem to be actively developed. But then again, I saw a patch to Qpsmtpd supporting tipjar recently.</p><p>IMAP Server<br>Net::IMAP::Server</p><p>POP3 Server<br>POP3 is not a necessity in my world, but I know people who still use it. I haven't found any (recently active) Perl POP3 Server yet.</p><p>Mail storage<br>Email::Store (and PostgreSQL)<br>Even if it seems to be Abandonware like the rest of Perl Email Project (http://emailproject.perl.org/) (it hasn't been touched for the last two years), it has at leas the notion of headers, body, attachment et al. There's also a database backend, which is a nice touch. With a proper database you would avoid the problem that the server could choke after only a few thousand emails in a folder. Also you could use all of the advanced features of your database. Full text search, for example, if you use Postgres.</p><p>Text search<br>PostgreSQL fulltext search<br>Other options: Use a text indexer, e.g. Xapian.</p><p>Mailing lists<br>and more. I'm sure there are more modules you could fit into a mail server. I didn't find a ready-to-use mailing list implementation, but it wouldn't be too hard to make one from scratch or from already existing modules.</p><p>Why would you want an all-Perl Mail Server? Well, you don't necessarily. But it would be easy to plug in some module to process an email for whatever reason it could support your personal or professional needs. Perhaps you would like specialized statistics on your email storage or email usage? Mail archiving? Easy program / email interaction?</p><p>This was just a thought experiment. I do wonder what happened to the Perl Email Project, though.</p> kaare 2008-10-31T10:06:28+00:00 journal qpsmtpd http://use.perl.org/~kaare/journal/37631?from=rss <p>Recently I had to move my mail domains off an external server and on to my own. It was an old Courier-MTA based implementation, and while there was supposed to be some kind of spam control, it obviously didn't have much impact, giving me several hundreds unsolicited mails to remove every day.</p><p>Now, there are a lot of options when deciding what to do with your mail, but I decided to try out qpsmtpd, it being Perl based and me having heard good things about it from people i respect.</p><p>I installed it, looked around and wrote some plugins for my special purposes. There are several plugins included in the distribution, and while the API documentation isn't obvious to find, you can mostly guess what is going on from the plugin code. I wanted to keep some of my p<br>revious Courier implementation and user database, but opted for another MTA.</p><p>One of Qpsmtpd's claims to fame is that it will detect wrong connections and bad senders very early in the process. This means that the server will save a lot of CPU and disk power simply because the you will receive almost only the real emails, not spam.</p><p>My conclusion: Qpsmtpd is fun. It is completely plugin based, so it will handle you the transaction at various stages of the mail receipt process and lets you have a go at it without limiting you unnecessarily. You decide what to do with the connection, and where to put the mes<br>sage.</p><p>The fun thing about Qpsmtpd is that it seems to be a well kept secret. People don't talk out loud about it. There is almost no CPAN presence, and you have to search to find a hidden (but active) mailing list.</p> kaare 2008-10-09T19:56:09+00:00 journal Catalyst CRUD http://use.perl.org/~kaare/journal/37124?from=rss Catalyst is great. Unless you want it to help you build simple applications. I'm not trying to take the wind out of claco's sails (<a href="http://use.perl.org/~jk2addict/journal/37068">http://use.perl.org/~jk2addict/journal/37068</a>) but I do expect him to conclude that Catalyst lags in this area, compared to other popular frameworks. <p> Not that this conclusion is a revelation from God. There are a lot of different initiatives trying to fix one or the other problem or adding some feature to make it simpler to develop - either by easing the creation of repetitive tasks or removing some technical barrier. </p><p> I've started listing these projects here: <a href="http://dev.catalystframework.org/wiki/crud">http://dev.catalystframework.org/wiki/crud</a>. Until now it's just a project list. But don't hold back, please add any information, technical tidbit or comparison. It's a wiki after all.</p> kaare 2008-08-07T18:49:03+00:00 journal Software announcements http://use.perl.org/~kaare/journal/36721?from=rss <p>Firefox 3 yesterday and OpenSUSE 11.0.<br>(http://download.opensuse.org/distribution/11.0/iso/ for CD's, DVD's and Torrents) today. I guess I know what my internet connection is doing tonight.<br>It seems that OS 11 has been anxiously awaited. OpenSUSE's homepage has been down for the better part of today. And as far as I can tell, the announcement isn't even official yet.</p><p>And yes, I consider OpenSUSE the best Linux distribution there is. And I hope that the positive reviews of alphas, betas and RC's will prove themselves justified.</p> kaare 2008-06-19T10:39:58+00:00 journal gvim as a Perl IDE http://use.perl.org/~kaare/journal/36688?from=rss <p>I've decided to polish my gvim installation in order to have a more IDE like environment. Initially I wanted to find a replacement, but after looking at a lot of alternatives (trying some), amongst them eclipse, Geary, Kdevelop, Komodo, and more, I dedided to give (g)vim another chance.</p><p>Now, I've had perl-support [1] installed for some time now, and I find it quite impressive. I admit not having used all the features of this comprehensive package, but I'll definitely try out more features in the future.</p><p>So, today I've installed omniperl [2]. It seems to sorta work, but well... I can't even get the textbook example to work</p><p>my $now = DateTime-&gt;now;<br>$now-&gt;^X^O</p><p>shows nothing.</p><p>DateTime::^X^O does give me a long list, but DateTime-&gt;^X^O just gives me a "pattern not found" error.</p><p>I guess that regular use will show if this is a useful package. Next, I wanted to see PelySense in action, so I dug up one of Ovid's old posts [3]. After some fiddling with the details (seems that pp and pg clash with perl-support definitions) it also kinda works. I get documentation for some - put far from all - methods. Noticeably, it can't find any Catalyst or dbic POD.</p><p>Again, I might be able to find better ways to use these features, so I'll keep them around at least for some time. Now this seems to cover the basic capabilities listed in gabor's post [4] and then some, but I miss one of the more important IDE requirements, the concept of a project (keeping together a set of related files).<br>Now one could argue that if you do a standard project, all you have to do is find the files in<nobr> <wbr></nobr>./lib, but I would like gvim to be smarter than that. And at least smarter than it is by default, listing all files in alphabetical order. I think I'll try out the vim project extension [5], unless someone warns me not to!<br>Another more "projecty" way could be to use ack for searching through files. Guess I have to try out Ovid's ack integration sometime. Now if he just would release all his vim Perl enhancements in an easy to install way...<nobr> <wbr></nobr>;-)</p><p>[1] perl-support: http://www.vim.org/scripts/script.php?script_id=556<br>[2] omniperl: http://www.vim.org/scripts/script.php?script_id=1924<br>[3] Ovid on PerlySense: http://use.perl.org/~Ovid/journal/35574<br>[4] gabor's IDE blog: http://www.szabgab.com/blog/2008/05/1211438612.html<br>[5] project: http://www.vim.org/scripts/script.php?script_id=69<br>[6] Ovid's ack integration: http://use.perl.org/~Ovid/journal/36430</p> kaare 2008-06-14T15:02:26+00:00 journal A life detour http://use.perl.org/~kaare/journal/36067?from=rss <p>Allow me a personal journal entry. This past Wednesday let me experience a sudden change in my life.</p><p>The background is that I've had some strange spells the past 7 or 8 months. Feelings of skin numbness moving around, primarily up and down arms, legs, head, in a random fashion for a while, ending in a major headache. Strange and worrying, so I went to my doctor who sent me to a neurologist who in turn sent me to the hospital for a MRI scan.</p><p>Well, that's enough for most people to worry about, but when I met for the screening interview there was a surprise waiting for me. The doctor was surprised that nobody har meassured my blood pressure before in the process. So she did. And she went for another machine because this one was obviously not working correct. And she scrapped the second one too and used old fashioned stethoscope. After a moment of confused thoughts she said "I have to admit you to the hospital. I can't let you go with this pressure level!"</p><p>A bit shaken now, I used the elevator to get to Floor 9 where they quickly registered the first measurement as 220 over 170. And I didn't have a clue, how does things like that happen?</p><p>OK, maybe I should have had a clue. After all I've had this headache since saturday, even for me a 4 day headache is not common.</p><p>The quickly following ECG diagram showed that my heart is OK, that I haven't had this level long enough to make any damage, and this was confirmed by some of the blood samples, telling that the kidneys are unaffected too. A lot more testing and measuring followed this, but no conclusion has been reached yet.</p><p>Now I'm home for the weekend, but next week will bring more tests. Kidneys, eyes, perhaps even the MRI scan that was the original reason for the hospital visit, some of it _has to_ show why my pressure just went sky high.</p><p>And of course I want to know the reason for my original symptoms. Are they connected to this current problems, or am I falling apart in all categories?</p><p>OK, a little too dramatic now, perhaps? The truth is that I'm not really worried. At least yet. I feel great (after they helped get down the blood pressure) and every test they made has been negative. Hey, now I even know that I don't have diabetes!</p> kaare 2008-04-05T20:03:27+00:00 journal SOAP http://use.perl.org/~kaare/journal/35754?from=rss <p>Recently I had to implement a SOAP client and a SOAP server. Well, I didn't actually have to, I volunteered. Shows how stupid I am.</p><p>I will start with the conclusion. Note that this is my opinion, others may disagree, but Perl and SOAP don't match. Not quite yet, at least. I mean, SOAP is designed by a committe and adopted by the Java community and Microsoft. I can't imagine anything more developer unfriendly. In the other corner we have our more or less relaxed &#8220;We can do it&#8221; Perl. But I found hope. More on that later.</p><p>My last visit to SOAP in Perl land was some 5-6 years ago when the World was young and Perl land was unstructured as Hell. (Actually I don't know if Hell is unstructured or not, perhaps it's written in Java. That would make sense, I guess).</p><p>But I digress. At that time there was only one real choice if I recall, SOAP::Lite. The &#8220;Lite&#8221; in SOAP::Lite is a misnomer. Perhaps it started out as Lite, but now it just feels big and bumpy.<br>Actually, as far as I can see, SOAP::Lite really only supports RPC/Encoded. The documentation mentions partial support for Document/Literal but I believe it's not really there.</p><p>RPC/Encoded doesn't really fit the bill if you want well structured schema based remote actions, so for this Catalyst project, so I was aiming for RPC/Literal. There's also Document/Literal, but RPC/Literal fits almost exactly together with Catalyst's Component model.</p><p>I've already complained about SOAP::Lite, but fortunately there's a new module that can compile schemas and apply them to SOAP. XML::Compile from Mark Overmeer seems like a fresh breeze of air and just understands the SOAP protocol.</p><p>Daniel Ruoso has built Catalyst::Model::SOAP and Catalyst::Component::SOAP on top of XML::Compile in order to help build Catalyst applications easier. I would add that the Model part feels almost finished. The Controller bit needs a lot in the SOAP Envelope packing/unpacking. But at least it got me going.</p><p>Developer pain.<br>Some of you may know already &#8211; and somewhere in a dark spot in my mind I had it stored &#8211; that you need a WSDL file when doing SOAP. Wouldn't it be nice to have a tool to write it for you? My hopes where high when I found Pod::WSDL on CPAN. It's a really nice idea to embed the parameter and type informaion in the methods Pod. But again, Pod::WSDL can only output RPC/Encoded.</p><p>Now, WSDL files are not hard to hand write if you know what you are doing, it's just a tedious and error prone task. So if you have some spare time, pick up Pod::WSDL (it's unmaintained at the moment) and add RPC/Literal and Document/Literal. The source code looks well laid out and easy to understand. Please implement a more economic solution for complex types. If each complex type really relly needs its own package, at least make Pod::WSDL find it within one file.</p><p>As an added benefit, by implementing SOAP in the Catalyst application I got rid of Catalyst::Plugin::XMLRPC. That's a good thing because it had a mysterious habit of leaving all the requests as open files. I mean A LOT, it could be thousands, depending on how busy the 'webservices' bit was.</p><p>I have plans to extend Catalyst::Controller::SOAP with some SOAP Envelope unpacking and response handling based on the wsdl file. When I get time...</p> kaare 2008-02-25T19:07:36+00:00 journal PostgreSQL 8.3.0 is out http://use.perl.org/~kaare/journal/35571?from=rss PostgreSQL 8.3.0 is finally released! See <a href="http://www.postgresql.org/about/news.918">http://www.postgresql.org/about/news.918</a> <p> Full text search, XML and UUID data types, ENUMS are amongst the fancy new features. </p><p> Of course they also threw in a bunch of performance improvements and tools to help you tweak the configuration, like async commit, HOT, and more. </p><p> There are updatable cursors now, but I guess that we don't get much effect from that until DBD::Pg can handle cursors.</p> kaare 2008-02-04T13:26:40+00:00 journal Promises, promises http://use.perl.org/~kaare/journal/35512?from=rss <p>One important part of human interaction is that you can trust someone and that you yourself is trustworthy.</p><p>This is even more true when you do project work. In fact that is the contract between the project management and developers - and between developers themselves.</p><p>I don't know how often I've put in an effort to lift my part of the work, only to find that others really couldn't care less about the deadline, the users or the customers that really really need this project to finish.</p><p>My usual response is to try to help, lifting some of the work that others should have done. Sometimes I get so tired of this that I want out.</p><p>I think the problem has been escalating lately. Or is it just me being more sensitive?</p> kaare 2008-01-29T09:54:22+00:00 journal New job http://use.perl.org/~kaare/journal/35048?from=rss <p>I started on a new job a couple of weeks ago. Not that I was tired with my old, on the contrary. But some project related things got to me, I must admit. I wish project management would be taken seriously more places than it does.</p><p>Here in Novozymes I work with Catalyst, DBIx::Class and Postgres. Couldn't be better. Mason instead of TT, but it's a matter of taste.</p><p>The application is a couple of years old already, so there is an existing code base to care about. But I'm rather optimistic about that we'll move quickly from here. At least that is what I'm hired to do.</p> kaare 2007-12-05T12:29:17+00:00 journal Anna &amp; Rolando (and the others) http://use.perl.org/~kaare/journal/35046?from=rss <p>WARNING! Nothing perl related here. Please move on!</p><p>So, last Saturday I visited my friend for dinner, wine (lots) and music. Well, Opera.</p><p>He'd bought a Live Recording of L'elisir D'amore (2006) with Anna Netrebko and Rolando Villazon and the Wiener Staatsoper.</p><p>I've always considered Donizetti a "real" Belcanto composer - lots of beautiful music, no consistent action. But this recording was different. The Opera felt coherent thanks to the performance of Anna and Rolando.</p><p>Rolando Villazon can't help being a very happy young man, or a big charming boy, if you prefer.<br>And Anna Netrebko. Oh my God! She's very pretty on pictures. But when you see her "live" on video! Couldn't be more charming.<br>Those two seem the perfect couple, and of course the get each other in the end (at least in the Opera, I can't tell about real life, but who cares about real life!).</p><p>It all wouldn't matter too much if they couldn't sing. But again - the easiness by which Anna just sends out coloraturas right and left was astounding.<br>And Rolando had to repeat his Una furtiva lagri - says it all!</p><p>Go buy! Get! Listen!</p> kaare 2007-12-05T12:05:05+00:00 journal My new laptop http://use.perl.org/~kaare/journal/34898?from=rss <p>I'm writing this journal from my new laptop, an Acer Aspire 5920. This thing has a dual processor Intel CPU, 2 GB RAM, and all the ports and connectivity we are getting used to (4 USB, Infrared, Bluetooth, 811.G wifi. etc).</p><p>Actually it has the first laptop keyboard I feel comfortable with. Only missing is the separate numeric keypad.<br>It even comes with a webcam, so I can see them when I chat with friends and family.</p><p>The most encouraging is that OpenSUSE 10.3 installed with almost no problem. Only wifi sent me googling for a couple of minutes.</p><p>Using wifi is still a little strange though. I had to switch from Network Manager to ifup/down. I don't quite understand what the problem is, but if I try to connect with Network Manager, it doesn't get an IP address. I could experiment with fixed addresses; perhaps I'll do that one day.</p><p>Overall I'm impressed what you're getting for your money these days. A new laptop with very competitive hardware for DKK 5,000.- (around EUR 665,-).</p><p>I had to buy a new laptop because my 3-year old one suddenly began to turn off completely after being on for only a couple of minutes. And these days it's easier (and probably cheaper) to buy a new and much stronger computer.</p><p>So I've been tinkering with this for the last couple of days, restoring relevant data from my old and customizing it the way I like it. A rather big job<nobr> <wbr></nobr>:-)</p> kaare 2007-11-14T11:44:18+00:00 journal Perl::Critic &amp;&amp; Perltidy http://use.perl.org/~kaare/journal/34800?from=rss <p>Two issues emerged from Jonas' Perl::Critic talk at yesterdays CPH.pm meeting.</p><p>Straying away from the topic, I learned that Perltidy won't accept Error.pm's try/catch/otherwise as a control structure and consequently doesn't format it the way I like. I like to cuddle my elses (yes, I'm that kind of guy) and would like this formatting for a try block</p><p>try {</p><p> &nbsp; &nbsp; &nbsp; &nbsp; do something</p><p>} catch<nobr> <wbr></nobr>... with {</p><p> &nbsp; &nbsp; &nbsp; &nbsp; do something</p><p>} otherwise {</p><p> &nbsp; &nbsp; &nbsp; &nbsp; do something</p><p>};</p><p>but it seems that Perltidy can't do that. Can anyone confirm this?</p><p>The other issue is that Perl::Critic fails make test. I tried on a fairly OK Perl installation, and I see that this issue already has been reported:</p><p>t/20_policies.............................NOK 69/682<br># Failed test 'BuiltinFunctions::RequireGlobFunction - line 19 - Multiple globs via '<br># at t/20_policies.t line 95.<br># got: '2'<br># expected: '1'<br># Violation found: Glob written as at line 2, column 11. See page 167 of PBP.<br># Violation found: Glob written as at line 2, column 19. See page 167 of PBP.</p> kaare 2007-10-31T11:08:14+00:00 journal TinyMCE++ http://use.perl.org/~kaare/journal/34644?from=rss I'm working on Yet Another CMS in my almost non-existing sparetime. A CMS needs a WYSIWYG editor, and anything that can save me time is a ++. <p> I tried FCKeditor, a really nice and very popular editor. But TinyMCE seems just much easier to set up. </p><p> It really <em>is</em> a matter of getting, unpacking and adding a couple of lines in the wrapper page: <code> <br> &lt;script language="javascript" type="text/javascript" src="../js/tiny_mce.js"&gt;&lt;/script&gt;<br> &lt;script language="javascript" type="text/javascript"&gt;<br> tinyMCE.init({ mode : "textareas" });<br> &lt;/script&gt; </code> </p><p> TinyMCE is at <a href="http://tinymce.moxiecode.com/">http://tinymce.moxiecode.com/</a></p> kaare 2007-10-10T08:15:29+00:00 journal PostgreSQL 8.3 Beta 1 http://use.perl.org/~kaare/journal/34636?from=rss PostgreSQL 8.3 hits beta 1: <a href="http://www.postgresql.org/about/news.872">http://www.postgresql.org/about/news.872</a>. <p> There's an impressive list of new features and improvements, performance enhancements included. </p><p> Some of the new features are quite interesting. Full text search right there in the database. Would it be useful for a Webshop, a CMS, etc? </p><p> XML is now also right there in the DB. I have to play with this. I have a schema with descriptions of rows and columns for financial reports. Ordinary database row definition is a poor match for this. Perhaps SQL/XML will solve this problem. </p><p> Enums may make all these small support tables obsolete. We'll see. </p><p> And finally (on today's list, there are many more news in 8.3) we have updatable cursors. I hope it will occur in DBD::Pg as soon as possible. </p><p> 8.3 really excites me.</p> kaare 2007-10-09T08:17:10+00:00 journal Installation woes are over (?) http://use.perl.org/~kaare/journal/34606?from=rss <p>My kids have been using my brand new computer for games. My Goodness! I didn't know that there are so many high quality games for Linux!</p><p>Meanwhile I've used my plain old laptop for work. There are a lot of reasons for that, one of which is that I haven't had the time to set up the necessary environment, including the main Perl packages.</p><p>Yesterday I wanted to fix this problem, starting on an almost 'naked' box with only OpenSuse's Perl installation. I always prefer CPAN over distributor's packages if there's no special reason against, so I started up perl -MCPAN -e shell and installed</p><p>SVK<br>Catalyst<br>DBD::Pg<br>DBIx::Class</p><p>remembering previous dependency nightmares and missing Linux libraries. SVK complained about a missing SVN::Core, but I know this, so I anstalled Perl binding with YaST. After that, no problem at all. SVK's tests were time consuming, even on an AMD 64 6000 with two cores. But in it went.</p><p>And amazingly, so did Catalyst and DBIx::Class. People there must have used a lot of time since my last 'clean' install getting things straightened up.</p><p>I'm impressed.</p> kaare 2007-10-04T07:52:32+00:00 journal New computer, Part II http://use.perl.org/~kaare/journal/34256?from=rss I wrote <p><div class="quote"><p>So to see that I can get an Athlon 64 Dual Core 5000, 2 GB RAM and a harddisk that could have acted as a data center 10 years ago for a few thousaned DKK makes the heart beat faster and eyes glimpse extra.</p></div><p>Actually I decided on an AMD Dualcore X2 6000+, NVIDIA NFORCE motherboard with 2GB RAM and 250GB disk.</p><p> The proposed Graphics Adapter - NVIDIA GEFORCE 8600GT - was coming with active cooling, so I decided to change to a 8500GT with passive cooling and a more quiet power supply.</p><p> It will be here in a couple of days, and I'm rather anxious to install Linux and start to measure, and feel, the performance gain compared to my three year old Fujitsu/Siemens laptop.</p> kaare 2007-08-29T07:03:42+00:00 journal New computer http://use.perl.org/~kaare/journal/34176?from=rss <p>How dificult is this!</p><p>I need a new PC, mainly for coding Perl. Well, "need" may not exactly be the correct term, but when the laptop reacts with a rubber like response and is getting warm enough to keep the coffee warm, at least I have a wish for something better, more productive.</p><p>I'm that kind of person who doesn't really care about hardware. Only checking the price / performance and features whenever I need a new thing of some kind.</p><p>So to see that I can get an Athlon 64 Dual Core 5000, 2 GB RAM and a harddisk that could have acted as a data center 10 years ago for a few thousaned DKK makes the heart beat faster and eyes glimpse extra.</p><p>Wasn't it only for Perl coding, you say? Well, my experience tells me that it's better to overshoot the current target if I want to be happy with the computer for a couple of years. And that is my plan.</p><p>But of course we have the old fashioned snake in this Paradise. Of course I will be running Linux, and out of habit I'm checking compatibility, believing that no problems remain.</p><p>Perhaps I'm getting too close to the problems, perhaps I just took chances in the past. But I'm surprised to hear about motherboards not supporting Linux, sound and wireless devices not being recognized and more.</p><p>Graphic adapters are the classic problem, but AFAICS most cards from the leading vendors work right out of the box. At least GeForce seems to be well covered.</p><p>And then I need to decide if I will build it myself (either a kit or assemble all parts from different shops) or buy a ready-to-use computer.</p><p>What do you think?</p><p>Investigating the different combinations already cost me a lot of time. But at least it's great fun<nobr> <wbr></nobr>:-)</p> kaare 2007-08-22T09:17:58+00:00 journal New car http://use.perl.org/~kaare/journal/33424?from=rss <p>I bought a new car last Tuesday. Well, it's a used car, but new to me<nobr> <wbr></nobr>:-)</p><p>I discovered that more than 95% of my driving is for business purposes. Either to and from a client, purchasing items or delivering these items to customers.</p><p>So I needed a bigger car than my trusty old Seat Cordoba. I've been looking for the right choice for over a year now, but didn't find the right combination of price, size, and service cost.</p><p>Recently I learned that a Toyota HiAce with 9 seats exists as an option for me with an ordinary driver's license. I found one in Jylland (some 450 kilometers away) and bought it after advice from my Nephew. He's very interested in cars, always updated and is educated as a Car mechanic.</p><p>Me? I see cars as a tool for getting from A to B. Of course some cars have better design, smarter features than others. But the price impact is almost always too great. Especially with the Danish tax system that has implemented the great "Take one, pay three" offer.</p><p>I have to get used to two things. First, it's with automatic gear. I've never tried this until now, but apart from a restless right arm, it's great.<br>Secondly, the new car is BIG! It's one meter longer than the Cordoba. The difference in plain traffic isn't that big. But when parking, or when space is limited, it's another story.</p><p>Impact to the environment was also a factor to consider, and one reason it took so long to decide on a car. But I had to admit to myself that we couldn't do without.</p> kaare 2007-06-04T18:15:56+00:00 journal After lunch, before Christmas http://use.perl.org/~kaare/journal/33176?from=rss I guess this journal should have been out Sunday at the end of NPW07, but I will adhere to The New Perl Catchphrase (See Subject). I think about using it for my contract work, but on the other hand I'm afraid that my clients will use it afainst me when I ask for the paycheck. <p> Like everybody else, I'm anxious about the frontline development in Perl. So I attended </p><ul> <li>Leon Brocard (acme) - What's new in Perl 5.10?</li><li>brian d foy - Learning Perl 6</li><li>Jonathan Worthington - Classes, Roles and Constraints in Perl 6</li><li>Nelson Ferraz - Adventures in Perl6</li></ul><p> All very, very nice presentations. Just like the first time I read the Apocalypses, I will say: "Gimme now!" </p><p>Can't wait for Christmas...</p><p> I also attended </p><ul> <li>brian d foy - Flexible Business Rules with Brick</li></ul><p> I still can't really figure out which problem domain Brick is solving. Brian talked about Business Rules, but in reality described a Next Generation Input Validator. For me Business Rules are all about computing taxes, deciding how to do the accounting for your automatic invoicing etc. Perhaps the validator is only first step?</p><p> If I weren't so tired Sunday afternoon, I would have bugged Brian, but at that time I could think of nothing more than my nice, soft couch. </p><p> I guess I'll try to catch Brian another time, perhaps there is a mailing list or an IRC channel. </p><p> There were a lot of other very fine talks, and the event went really, really smooth. Hard to top next time!</p> kaare 2007-05-02T07:00:18+00:00 journal Scream, Bitch, Scream! http://use.perl.org/~kaare/journal/33107?from=rss I just spent 5 hours yesterday debugging, searching for a bug in a Catalyst/DBIC application. How life would be easier if DBIC would die screaming instead of just bailing out in silent mode. <p> Combined with Catalyst's very talkative error trace, I get tons and tons of nonsense, and no useful information. In this case I was told that the problem was that there was an earlier transaction with problems. Well doh! Not very interesting. Tell me why you die, please. </p><p> Another thing about DBIC seems to be that <code>$schema</code> is utterly useless after a failed <code>txn_do</code>. You can get a resultset, see the classname, resoultsource etc. But <i>don't you dare</i>! to find some data. Why? Well, I don't know.</p> kaare 2007-04-26T10:41:59+00:00 journal Sickness-- http://use.perl.org/~kaare/journal/33057?from=rss I was sick all week of Easter. I mean really sick with <i>p</i>ills, <i>p</i>ain and <i>p</i>hever. Thatsa good boy, taking your sick time in the Holidays. Very clever!<p> But every day since then I've developed fever and pain during daytime, until two days ago I had the first day with no pain killers. My Goodness! What's the point? Depression is an extra added bonus, feeling power- and useless. </p><p> Well, now it's over at least, and I can start on the piles that has built themselves in the meantime<nobr> <wbr></nobr>:-(</p> kaare 2007-04-21T08:03:30+00:00 journal The Perl Review http://use.perl.org/~kaare/journal/32869?from=rss <p>Woohoo!!</p><p>TPR 3.2 arrived here yesterday, even without having me bother brian about it!</p><p>I know it's late compared to everybody else, but hey! Surface mail to Denmark is recognized as the slowest moving item on Earth.</p><p>I don't know how many times I've had to request him to send me a new copy because the first was lost in the mail (never any complaints), but now there's hope. The last two issues arrived</p><p>The content is not really new, though, as I couldn't help skimming the PDF version. Most important: A lot about Nordic Perl Workshop, this year's most important event!<nobr> <wbr></nobr>:-)</p> kaare 2007-04-01T16:54:27+00:00 journal DBIx::Class ResultSets http://use.perl.org/~kaare/journal/32830?from=rss <p>It's easy to do single-table stuff with DBIx::Class. And even more complex actions are well supported, but you risk duplicating your code if you don't watch out.</p><p>Especially if you use Catalyst, it's easy to write the same piece of code to fetch or update related tables in several controllers.</p><p>This will surely and quickly become a problem.</p><p>Some people will have this in the Model layer of Catalyst. It's OK if all your work is guaranteed to be Catalyst. But what if it's not? What if you want to access your database from e.g. a stand alone server or a cron job?</p><p>I use DBIC ResultSets to fill out the hole between simple DBIC classes and the actual code I think that RS suits the bill in a nice way.</p><p>This is one way to have more complex database code with DBIx::Class. I'm sure there are a lot of other ways to do it. And I'm sure some people will tell me why I'm wrong<nobr> <wbr></nobr>:-)</p><p>But it's easy to do. Just watch.</p><p>In Project::DB::Class:<br>__PACKAGE__-&gt;resultset_class('Project::RS::Class');</p><p>Write methods in Project::RS::Class, e.g.</p><p>sub create_full {<br> &nbsp; &nbsp; &nbsp; &nbsp; my ( $self, $args_ref ) = @_;</p><p> &nbsp; &nbsp; &nbsp; &nbsp; $self-&gt;check_defaults($args_ref);<br> &nbsp; &nbsp; &nbsp; &nbsp; $self-&gt;validate_data($args_ref);</p><p> &nbsp; &nbsp; &nbsp; &nbsp; # Get schema<br> &nbsp; &nbsp; &nbsp; &nbsp; my $schema = $self-&gt;result_source-&gt;schema;</p><p> &nbsp; &nbsp; &nbsp; &nbsp; $schema-&gt;txn_do(<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sub {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Do something<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; &nbsp; &nbsp; }<br>}</p><p>and then use it from your controller, script, whatever:</p><p>$schema-&gt;resultset('Class')-&gt;create_full($args_ref);</p> kaare 2007-03-29T10:16:06+00:00 journal Copenhagen in flames? http://use.perl.org/~kaare/journal/32543?from=rss Copenhagen in flames, eh? <p> Somehow it looks scarier in television than IRL. Unless you live within a few hundred meters from Jagtvej 69.</p> kaare 2007-03-02T13:37:32+00:00 journal