Stories
Slash Boxes
Comments
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 ]

Simon (89)

Simon
  simon-use-perl@perlhacker.org
AOL IM: lathosjp (Add Buddy, Send Message)

Busy Man.

Journal of Simon (89)

Tuesday July 23, 2002
03:12 AM

Moved!

Want to follow my blog without ever leaving use.perl? The use.perl RSS Feed lets you check up on me without leaving the house!
Thursday July 04, 2002
05:43 PM

Goodbye

Blosxom is lovely, and lets me take my blog home. So I'll be writing from there from now on. Oh, yes, and importing the use.perl blog into blosxom was quite fun.

So, bye for now, hope you'll catch the blog at its new home - oh, and Config::Auto is out.

Wednesday July 03, 2002
12:14 PM

WANT TO GO HOME!

I want to go home, but I've got started hacking a really neat little Perl module, and I've only got two subroutines left to do. In fact, stuff it, I'm going home. I can finish this off tomorrow.

So, about the module. It's called Config::Auto, and I've written it because I never want to write another config file parser ever again. So, this little baby looks around for a likely-looking config file, sniffs it to work out what sort of format it's in, and has a good shot at parsing it into a Perl data structure. It deals with XML, INI files, Perl files, lists and the more "vague" Unix-style colon-separated, equal-separated and space-separated files.

For instance:

# tortuous.pl
use Config::Auto; use Data::Dumper;
print Dumper(Config::Auto::parse());

This looks around my filesystem, and finds .tortuousrc, which looks like this:

test: foo=bar, baz=quuz
test2: blah
blez: quux

And, with no other prompting, it comes back with:

$VAR1 = {
            'test2' => 'blah',
            'blez' => 'quux',
            'test' => {
                        'foo' => 'bar',
                        'baz' => 'quuz'
                      }
         };

Laziness: check.
Impatience: check.
Hubris: check.

10:59 AM

Some thoughts on donation models

In reply to a thread on Free Software Business:

I have two problems with the open source donation model.

The first is that open source projects are made from code, and the best donation I can give them is not money but code. In the case of Perl, I maintain nearly 40 modules, managed the release of the first few versions of the Perl 6 interpreter, and have contributed many patches and documents to the Perl 5 core. I feel absolutely no guilt at all for not giving a single cent to the fundraising drive.

If all we did was throw money at a small number of people to get the code written for us, there'd be no community to maintain.

Second, and far more seriously, donation models reinforce the myth that software is important in any meaningful sense of the word. Of course, software is relatively important to programmers, but for the vast majority of the world, it's pretty meaningless.

I'm very lucky that I have the opportunity to give reasonable sums of money to charity reasonably often. When this happens, I naturally have a number of things vying for my donations. Here are a few:

  • Work with homeless people in my home town.
  • Care for the elderly mentally ill.
  • Providing AIDS vaccines for children in Africa.
  • Digging wells and providing fresh water for villages in Pakistan.
  • Allowing privileged first-world programmers to sit in front of a computer for more hours than they currently do.

Put like that, I hope it is clear that software is not as important as the biased eye of a programmer may perceive. Indeed, no matter how much of my income I derive from the existence of a given open source project, it becomes very difficult for me to fail to take a global view in cases like this. The common counterargument that I should donate money to Perl because it provides my livelihood makes sense only for those who cannot see beyond their own needs.

Meanwhile, I know full well that as Perl is an open source project, it'll continue to be maintained and developed whether or not people are paid to do this. This makes it even more difficult for me to help the poor white-bread middle-class afflicted.

So I'm happy to contribute to Perl in my own way, but I'd rather not lose my sense of priority.

08:21 AM

Idea of the day

I've just written something using Leon's excellent GraphViz module to turn a Shishi parser into a nice diagram of the state machine. While GraphViz turns a data structure into a graph, it would be really lovely for parser tuning to be able to play around with the graph in dotty and then read the resulting graph back into a data structure...
Tuesday July 02, 2002
11:37 AM

Class::Dynamic released

This is a module I threatened to release to the world a while back. Do evil things with it...

=head1 NAME

Class::Dynamic - Rudimentary support for coderefs in @ISA

=head1 SYNOPSIS

  package Blargh;
  use Class::Dynamic;
  our @ISA = ("Foo", sub { rand < 0.5 ? "Bar" : "Baz" } );

=head1 DESCRIPTION

This module allows you to insert coderefs into a class's C<@ISA>.

08:51 AM

Home and tired

I got back from YAPC yesterday after a reasonably sleepless night flight. I was slightly suspicious to find my mail sorted and the kitchen tidied. But I was too tired to work out what was going on, so had a bath and forced myself into work, which was possibly a bad idea. I took the rest of the day to catch up with what's been going on here, and then returned home to find, yes, I had indeed acquired a housekeeper.

By way of explanation, a friend had been staying with someone who's since moved back to Japan; she then planned to move to Cheltenham, leaving her bags at my house for the time being. However, the Cheltenham idea also fell through and she was stuck in Oxford homeless. So she's staying with me for now.

At the airport on the way back, I managed to get a lot more done on Shishi, and so I've released the prototype to CPAN; I've also got a reasonable stab at an approximate Perl 6 regular expression compiler which compiles to a shishi parser. Unfortunately, it's got to the point where it's really very difficult to build up the data structures that I need from a simple-minded tokenization of a Perl 6 pattern, and I'm left trying to bootstrap Shishi by hand-coding a parser. This is not fun.

This morning, we finished the 6 week Perl course I've been teaching. We did half the lesson on CPAN modules, looking primarily at the modules in my "10 modules" talk from YAPC. Of course, we got to a demonstration of LWP::Simple just as the demonstration web server was being upgraded, so I had to puzzle over why one person's code worked fine, but someone else's identical code a few minutes later didn't work. In the second half, people built a news ticker utility out of LWP, Mail::Send and dodgy screen-scraping regexes. Good fun, and I think people finished the course with an idea of how to do relatively complex things in Perl - given that the previous course got to subroutines and just abruptly ended, I think adding the modules lesson was a big improvement.

And now, after a flight, a bad night's sleep, and about three hours teaching, I'm utterly shattered.

Tuesday June 25, 2002
10:33 AM

Dispatches from STL

23/7/2002 - St. Louis

Woke up too early, and wrote a Perl 6 regular expression engine. Don't you just hate it when that happens?

At 6:30, I headed off to find some coffee, which was more of an ordeal than I expected. The hotel's on the edge of quite a small town, and nothing opens until at least 7am. Finally, I wandered down past Concordia seminary, and found a lovely little cheap and tasty coffee bar on the corner. I got my stuff together and around 8:30 I was ready to head into St. Louis itself.

This town, as a famous man once said, is coming like a ghost town. St Louis is a weird, weird place. The car culture has driven a few of the usual things you'd expect to see in a city out to the suburbs. Basic things like "shops" and "people". Until around noon today, there was essentially nobody on the streets apart from me. (Granted, it was a Sunday.)

Even when the city started to liven up, I couldn't help noticing, while I was wandering around, that there wasn't really a central business district. There were a few delis, pharmacies and 7/11s dotted around, but not even so many of those. Instead, many of the downtown streets were filled with empty buildings, boarded up doors and the shells of long-dead shops. It was bizarre. Some of the most wonderful urban architecture I've seen in a prime position in the city center was just lying empty and forgotten. Even the St. Louis Center, a four storey shopping and restaurant complex, hadn't really taken off. Many of the units remained closed, and those which were let were not exactly inspiring.

The only signs of real civilization were the Busch baseball stadium, - complete with crowds of mourners for legendary baseball radio announcer Jack someone-or-other - the old Union Station, - now a restaurant complex - and the Gateway Arch - long queues and tight security. It took me half the day to find somewhere which would sell batteries, and then I took another few hours taking pictures of some of the great yet desolate buildings I'd seen. Finally, an hour long trip on a Mississippi steamer, before ordering a van ride back to the hotel. Then writing, writing, writing.

The language barrier is turning out to be a problem. I ordered a cheesesteak from the St. Louis Center when it finally opened, and was startled to be asked by the server "Why do we pray?" Well, I wasn't really in the mood for theological discussions, so I just shrugged. This wasn't enough. "Why do we pray?" This a trick question, isn't it? The server got agitated, and picked up two bags of rolls. "Why do we pray?"

Realisation dawned. "Oh, um, wheat, please."

Wednesday June 19, 2002
06:06 PM

Tired

Tonight, I: reviewed four chapters of galleys, ported Magicpoint to OS X, (No, I didn't ever enter the command vi /usr/include/stdio.h, no, not at all.) ran over my tutorial for tomorrow, despatched perl.com for the week, and had a few drinks with co-workers.

I think I'm allowed to feel tired after that.

11:03 AM

Twin peaks