In August 2001, I became a Perl 5 porter. These hooded and mysterious figures develop the latest versions of the Perl programming language and its core libraries. Most of my work has been focused on Kwalitee Assurance, ensuring that every piece of Perl is tested as much as possible. It's a tireless job, but occasionally someone notices.
Listed here are the patches I've had accepted into Perl, along with links to the actual diffs (where appropriate) and brief explanations. You may find it interesting or boring, but I've found it rewarding.
My first patch, this changed the documentation for using a non-blocking wait for child processes. It also broke Net::Ping, for which I was soundly and correctly chastised. The moral of this story is to run the test suite after you mess with things. sky fixed this in 11762.
Japhy wondered why English.pm module assigned complete globs. I fixed it not to do that. Turns out there's a weird is-it-a-bug-or-not with local() that does the wrong thing, sometimes, with aliased names. My patch had a bug in it. Jarkko asked if there were a test for English.pm. There wasn't. I had a plan.
I'd forgotten about %! when aliasing *OS_ERROR to $!. That means 11890 had broken %OS_ERROR, though $OS_ERROR was okay. The moral of the story is to write tests. Another good moral is to read perlvar.
Having learned several lessons, I put them to good use by writing my first test. This proved that English.pm behaved like I would expect it to behave. Your expectations may vary. Patches welcome.
Lots of other core modules were untested, including less.pm. Would that they were all this easy.
Poking around in my oft-neglected rewrite of File::Find, this test bugged me enough that I rewrote it to use Test::More. I don't think I fixed any bugs, though this test would fail in a few places on several platforms as tainting and chdir() got some extra attention.
This added tests for ExtUtils::testlib.
This added tests for ExtUtils::Manifest. Schewern had a couple of nits and rewrote the patch slightly and Jarkko applied that one. Sneaks. Now you know who *really* wrote it.
Tests for the previously untested CGI::Fast module. It took a little bit of sneakiness to achieve this, since FastCGI may not be installed. I sent this off to Lincoln Stein. Schwern resent it later with a bunch of other changes. He got credit for it. Sneak.
This was a fun test to write, as it took a bit of cleverness to make it work. There's some tied variable fun. This had some unportable assumptions that had to be worked out with fear and trembling, or at least with 12010, 12021, 12282, 12332, 12398, 12418, 12442, and 12512. Maybe "fun" isn't the right word, but I enjoyed finishing it.
I fixed a typo in the ExtUtils::Command documentation and introduced one into MANIFEST. That habit continues to this day. There were bugs in the way I handled the stat() call, especially on non-Unix platforms. Ironically, it's only useful on those platforms. (Then again, Nick Ing-Simmons admitted to creating the module under Solaris.)
Another new test, this time for CGI::Push. This was part of the big patch to the CGI distribution.
The test failed on a Windows machine, which made me wonder if interpolating a file name with backslashes in it was a good idea. This patch corrected that. In retrospect, I'm not sure what I was thinking, but it evidently worked. Sarathy's fix in 12183 looks a lot smarter.
A non-test patch. Jarkko lamented the long list of CPAN mirrors for those of us unfortunate to live in well-connected North America. He wanted a windowed list of potential mirrors that showed only 15 at a time. It didn't take long to write this patch. Both Jarkko and Andreas König liked it.
Someone reported poor test-fu in this test. When the breakage is pointed out so obviously, you don't have to know what the test is testing to fix the semantics.
Someone had this on the untested modules list. It wasn't, leading to a retraction in 12185. Paul Marquess had already taken care of the test and the documentation update in 12115. The moral of the story is to synchronize with bleadperl often.
I don't know much about EBCDIC. I did the best I could. Patches 12766 and 13302 prevent breakage. An EBCDIC-aware hacker could fix things up.
A rare foray into Perl's C code, this patch fixes a TODO. Namely, it deprecates the *glob{FILEHANDLE} construct in favor of *glob{IO}. The deprecation was planned for Perl 5.6, but didn't make it. It'll be in 5.8. No task is too small for me, especially if I'm just guessing at things.
These are simply tests for filetest.pm. Note that I didn't know what I was doing with the patch to t/lib/1_compile.t, making 12163 partially necessary. The moral of the story is not to do things someone doesn't tell you to do. (That's a terrible way to put it, but it makes sense to me.)
Another C patch, trying to figure out why PerlIO was accidentally dropping buffered output when switching layers. This was much easier to find than I thought it would be, which is probably why I was able to fix it. My solution worked, but it wasn't quite perfect. That lead to 13019. In retrospect, that's probably why the buffers weren't being flushed in the first place. Now, both groups of people should be happy.
Forgotten from 12254, this added tests for B::Terse. My head hurts, and I got a few things wrong. It wasn't my finest hour. 12694 explains some of the troubles.
I didn't know open.pm existed, but I wrote tests for it after I read it. 12294 made it a little more sensible, both in test names and in whacking nasty environmental variables that could cause errs.
While I was adding tests for Tie::Scalar, I discovered an apparent bug in the module and fixed it. It wouldn't ever call new() from TIESCALAR() in an inherited class. Weird.
Ugh. I thought I was brilliant, but I was just dancing around in the dark. This was messy, and took several revisions to get straight. It started innocently, with 12284 and 12285 (not my fault, though I have made similar mistakes plenty of times). I tried 12298 to fix things, then 12358 (superceded by 12362), then had to find a Debian box to create 12368. Sarathy found an odd class of bug in 12695. Finally, I got smart with 12836, and Jarkko made it beautiful in 12838. 12880 came about only because Term::Cap made its way to the CPAN as well.
Jarkko had mentioned that my test names could be improved, and this was one that made it evident. This patch came about when a Suse box set its locale slightly differently. It was a good excuse to change the names as well.
This was hard to write because the module sends the ABRT signal. The test tried to catch this, but I couldn't figure out how. That's why 12361 exists. Patches welcome.
New tests for CPAN::Nox, which use no XS modules to access the CPAN. This was easier to write than I expected.
Too clever for its own good, this test has puns and tributes in it. 12697 caught the strange case of people running this test as the root user. Who does that? 13250 caught files that weren't cleaned up on Windows. Whoops.
Having been burned by files that cannot be opened or deleted properly, I wised up and chained file opens in SKIP blocks, testing a flag to see if the next block should be skipped. In retrospect, this may be fragile. Shhhh! This was also affected by 12697.
Though I wrote other patches to handle this file more correctly, this one finally got to the heart of what is testable and what isn't. I'm proud of it.
Writing tests for Net::Config, I fixed some simple typos in the documentation. I should have sent this directly to Graham Barr, but he saw the patch and took care of it.
My first attempt at this reinvented one of the nicer bits of Getopt::Long. Luckily, Johan Vromans was on hand to re-educate me. There's more cleaning that could be done on this file, but it's a low priority.
The light bulb went off, and I realized that if no potential termcap file could be found, there was no reason to run the test. For something as portable as Perl, there isn't yet an easy way to test things that may not yet or ever run on a particular platform, or to say that even though the test runs, the thing tested may not work. Maybe I should go back to writing fragile tests.
Someone (Schwern?) added the PERL_CORE environmental variable that is set when running 'make test' within the core Perl distribution. There are several assumptions that need to be made in this case, including @INC paths. Jarkko's snapshot summary (at patchlevel 12892) had a TODO item to add this switch to the CGI tests. It was easy. I like easy.
Someone ("Root") posted a bug report where the first system warning out of the stat module would be blank. It turns out that the module require()s Carp to do error reporting only when necessary. $! would normally be set if the underlying stat() call fails, but loading Carp.pm clears it. The solution is to local()ize the variable. Easy fix, except for one thing...
By the way, have I mentioned yet that error messages vary across platforms? They do. Remember that. I usually don't. Checking %! and $! would probably be more robust, but I have to leave something for you to do.
I wrote most of these tests and sent them to Graham directly. It's easier that way, as libnet is also a CPAN distribution. The Net::Config test had one persistent failure, and eventually produced 13275 and 13291. (I'd asked about this very thing earlier, but it was ignored. Sometimes the best you can do is to write a test that fails and hope it annoys someone who can fix it into fixing it.)
The DB.pm module was tricky to test, and still could use some attention. My first attempt at this brought up a nice feature added to Test::More -- distinguishing between 0, '', and undef.
Another new test sent to Graham and later integrated into bleadperl. I may have missed some of these, as there's no fanfare when he does.
Benjamin Goldberg noted that my test didn't use the strict pragma. It doesn't make any difference to the operation (except for the symbolic references needed to match some of the trickier things DB.pm does), so I added it. As well, he pointed out that the contents of @DB::dbline had some special magic which ought to be tested. Easily enough done.