My Frozen Perl 2011 Keynote

I've uploaded the slides for my Frozen Perl 2011 keynote, in which I answer one part of the question "What are five things I hate about Perl?"

You may remember that I first asked that question in the introduction to Mastering Perl, so I've been thinking about this since 2005. I posted it on use.Perl in 2007 and Stackoverflow in 2008 (and Jeff Atwood picked up on for Stackoverflow Podcast #73 (around minute 47), although I'm not sure that. I might have picked it up from 5 things I hate about Ruby, which is about the same time that I would have been writing that for Mastering Perl.

Almost everyone fails this question though (and Jeff's answers are very weak). Most people don't think about it long enough, so they answer with very superficial, stylistic things that don't prevent them from doing anything but that is just their pet peeve.

In my keynote, I note that this interview question evaluates three things at once: real experience, depth & reach, and workarounds. How much have you actually thought about it, how much does that item actually affect the language and what you can do with it, and how you workaround it.

My answer is how use works. It takes a namespace and translates it into a filename, then traverses @INC looking for that filename, using the first one it finds. This has far reaching consequences:

  • You can only load a module that lives in a file of the corresponding name.
  • The direct correlation to a particular filename makes it virtually intractable to store multiple version of a module at the same time (a goal for Perl 6).
  • The filename is sometimes related to the distribution name, but sometimes not. For instance, how many people know which distribution HTTP::Request is in? How would you find out just by looking at the file?
  • Since you have to have a particular filename, your distribution structure is inaffected
  • Since they are just files, once installed you can't really tell which ones come from the same distribution.
  • We have to have PAUSE permissions to control who gets to create a file through a distribution through a CPAN client.
  • Since a distribution name is not necessarily related to the filename of the module, CPAN clients need a way to translate that. PAUSE jumps through a lot of hoops to index distributions, and CPAN clients have to get at that data (although cpanm does an end run in what I think is ultimately unsustainable).

So, a small design decision impacts quite a bit.

4 Comments

Are the slides available for download somewhere where you do not have to create an account (slideshare.net seems to demand login to download); perhaps a link directly to a PDF?

Thanks much!

My answer is how use works. It takes a namespace and translates it into a filename, then traverses @INC looking for that filename, using the first one it finds.

It isn't true. Take a look at inc::latest, App::FatPacker, PAR,... or even Acme::RemoteINC.

Leave a comment

About brian d foy

user-pic I'm the author of Mastering Perl, and the co-author of Learning Perl (6th Edition), Intermediate Perl, Programming Perl (4th Edition) and Effective Perl Programming (2nd Edition).