Almost every interview I've ever been on that consisted of these kinds of questions, I've gotten an offer. I agree it's a mostly useless exercise in trying to determine someone's technical skill, but as an interviewee, ultimately it makes more sense to just "play the game" and memorize the mostly-exhaustive list of questions.
Conversely, one interview I do remember where I didn't end up getting an offer, was going swimmingly talking about pirates splitting gold and manhole covers. And then one interviewer asked me with so much Perl experience, why hadn't I published anything on CPAN? Boom, done.
I still haven't published anything on CPAN, but could I interest you in this scale and 8 balls I have here?
I'd answer the question of why I haven't published on CPAN (which I haven't, and I primarily program in Perl for work) is that I don't have the time. I've published some small add-ons for Warhammer Online (Lua, not Perl), and have found that even such a simple thing as that, where it is common for add-on authors to abandon their add-ons and users do not expect much support, was a lot of time. That's because if I put it out there, I'm going to support it. If user's ask for features--even features I won't use--that make sense, I want to try to add them.
If publishing something in such a specialized and restricted universe is so much work, I would expect that publishing and maintaining (to my quality standards) a CPAN module, which would have a potentially much larger audience, would simply take more time than I have available.
My current policy is that unless a piece of code suddenly makes the world a worse place to be in (hopefully I haven't done that yet :) ) I'll release something (normally on my website) and make no further commitment than that.
My philosophy is that it's still better to have your code out there and unsupported where someone can have the option of using it, rather than leaving it stuck on a hard drive never to be seen or useful to the world at large.
While it pains me not to answer every person who emails me about code I put out there, I try to live with it. Plus, it gives them a chance to solve their problem for themselves. :)
In order to get to that point I had to get past the "Oh noes, what if people/future employer/rockstars see my code deride it, laugh in my face and not give me a job because the hacky code I put out is..hacky". I still have flashbacks though. :)
I would encourage you to lower your standards for publishing your code. Is there a "CPAN Unplugged" where lower standards are explicitly accepted and okay?
There are plenty of reasons not to publish on CPAN. Not everyone has time to "babysit" all the modules they write (and deal with people's complaints that they're misnamed, aren't complete enough, etc).
Also, lots of people who were once productive on CPAN years ago have "gone dark" in recent years. Generally has something to do with having a life (fulltime job, family, that sort of thing).
So all in all that's a pretty snarky question to ask. It's definitely a plus to show that you have the sense of civic engagement to go through the full-fledged publishing process on CPAN (including processing testing reports, RT issues, etc) but it should suffice to provide code samples with clean coding style and decent enough documentation (even if it's a well-written README).
Conversely, one interview I do remember where I didn't end up getting an offer, was going swimmingly talking about pirates splitting gold and manhole covers. And then one interviewer asked me with so much Perl experience, why hadn't I published anything on CPAN? Boom, done.
I still haven't published anything on CPAN, but could I interest you in this scale and 8 balls I have here?