After a version by Fredrik Lundh that I found on the web somewhere. (I like mine better, but of course that may have to do with my alcohol consumption. :-)