I gave a talk on Template Toolkit at the Sillicon Valley Perl meeting. I used these Template Toolkit Slides as I talked. Except I think I corrected the typos when I got home. =)
It’s a fun group, and I always enjoy going, even when I’m the speaker.
I gave a talk on Template Toolkit at the Sillicon Valley Perl meeting. I used these Template Toolkit Slides as I talked. Except I think I corrected the typos when I got home. =)
It’s a fun group, and I always enjoy going, even when I’m the speaker.
Many people have suggested I use autodie. I have never been interested in the functionality it provides, and don’t use it. I think there’s primarily two reasons why that is. I might know a way to address one of them, but it’s tricky. (more…)
In Perl, when you get an error, there are magic globals that the interpreter sets to the value of that error. If you’re going to do any other work before reporting the error, save those variables! Work almost got this right… (more…)
A question came up at work the other day, if you could override the Perl open() function. There’s many possible uses for this, but work’s was simple: we wanted a log of all files accessed during a program run. The program is large, complex, and uses many modules. An override of open() would let us record the file and open mode, then call CORE::open.
We couldn’t do it. After a second look, I still can’t do it. Not for all cases, anyway. (more…)
chromatic mentioned something in the preface to his book Modern Perl that I had been looking for but hadn’t yet found. He then went on to mention a couple of other things which were just plain neat. I knew about one of them, but not the second and thought they were both great ideas and thought I’d try and get them wider attention. (more…)
I wrote a post last week talking about how outdated a lot of Perl seems to be, and the comments were full of people discussing it. One of the things mentioned repeatedly was chromatic‘s new book Modern Perl. I had seen several of the posts where he discussed the book on his blog and knew it was coming, but it was news to me that it was released
Not only is it released, but chromatic has graciously made the book available for download as PDF. His publisher has it as both letter-sized and A4 sized formats for print. It’s released under one of the Creative Commons (by-nc-nd) licenses so you can use it, share it, and distribute it freely and widely. The blog announcement mentioned above encourages you to do so. (more…)
I work as a professional Perl developer. We have a large and complex system which is built around a lot of Perl. This system has been in use and in place for years, and handles an astonishing amount of load, using thousands of computers to do it.
I work with some excellent engineers, who are thoughtful, intelligent, hard-working folks. They want to make the best system they can, and they want it to be reliable and dependable. I have great co-workers.
I keep finding Perl that looks like it was written in 1990. I find code like this: (more…)
I was just in a room with three competent, professional Perl developers, all of whom agreed that you can’t strip whitespace from both ends of a string in a single regexp. (more…)
I wrote this some time ago, and it sat in the queue and got stale. I’ve mentioned one place I’m not using Config::JFDI, but I’m using it other places and I thought it desrved a mention.
I mentioned my old framework had a way to infer which configuration file to use by examining the environment it was running in. I’ve moved to the Catalyst Way of things (more or less) and that will make things easier. A bunch of my old code can go away.
I have some useful tools to do things which do like to read the config file, too. They used the same code. They now use Config::JFDI. It reads config files the same way Catalyst does, and gives you a very similar $config object you can use to look at things with.
I did have to dig in to the sources to get it to work right, even though it’s pretty well documented.
Several times, I’ve wished I could write command-line tools to manage Catalyst applications. Those tools, invariably, needed to call some of the Catalyst functions, or at least get to the database.
I had struggled with Config::JFDI and tried to create DBIx::Class objects outside of the Catalyst models so they could be used standalone. This sort of worked, but wasn’t as easy as I wanted.
I found a way, and it’s so simple it hurts. I can’t help think this is one of those things the Catalyst team will read and think, “Well, duh!” but it was never clear to me and I struggled with it for months. (more…)