So I upgraded to OS X 10.6 (Snow Leopard, which my fingers still refuse to type correctly the first try) recently. As advertised it doesn’t look much different, with most of the updates and upgrades occurring under the hood. Sadly, I’ve run into a problem that has existed for awhile but recently bit me.

Perl is a programming language. CPAN is, among other things, a repository for Perl modules. Perl modules are discrete units of Perl code designed to do specific tasks. So if you need to do a task in Perl and a module exists to do it, install the module and you can use it to do the task. There is even a CPAN module which allows you to install other modules. Neat!

Perl has versions. The version installed with OS X 10.6 is Perl 5.10. Previous versions of OS X have had Perl 5.9, 5.8, etc. From what I can tell, starting with the bundling of Perl 5.9, the Perl installations have not been complete, or at least not complete enough for CPAN to function properly. It looks for certain files in the ‘/System/Library/Perl/<version>/darwin-thread-multi-2level/CORE/’ folder, particularly the config.h file. And if CPAN doesn’t find this, it errors out.

For now, word on the ‘net is that you should copy an existing config.h file from an older version of Perl that you might have installed, assuming you upgraded from older versions of Perl. 10.6, however, seems to have cleaned out older versions of Perl. In my case I had Time Machine, so I was able to go back and pick up a stored copy of the files in that folder. Copying ‘config.h’ into place did the trick for me.

More fun though. What if that’s not an option? Well, I had installed the iPhone development environment, which includes XCode, but apparently does not include everything that the full XCode environment includes. I’ll try that at some point as well. From what I can gather, the problem is that the Perl install without development options does not include the ‘config.h’ file by default.

Still… yay fun times!