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.
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!
Slideshare is all there is, and there is no download. I can see the slides just fine without an account, and I've also embedded them in the post :)
It isn't true. Take a look at inc::latest, App::FatPacker, PAR,... or even Acme::RemoteINC.
Of course what I said is true. That you can have a module that makes a dynamic @INC doesn't make it any less true. Without black magic, what I said is how use() was designed. That we got black magic features later doesn't impact the consequences of that. Notice, however, that the black magic bits fit into my "workaround" portion of the question.