In article <[EMAIL PROTECTED]>,
        [EMAIL PROTECTED] writes:
> I have been involved in all 4 tournaments in the current series
> (Santa, Ton, Get Even, TPR). So has Ton Hospel, and I would be
> interested in hearing his opinion, as he produced both a
> 33-stroker and a 47-stroker in this game.
In fact i also would like the module rule to remain. The whole idea of
perl5 was that the module functions get on roughly equal footing with the
normal functions. To me, they *are* part of the core, and indeed strtol is
not very different from unpack except that you need an extra "use POSIX"
(long in golf) to be able to use it.

Ok, in this case lots of people converged on a simular 33 solution, but 
I think it was just bad luck. Even if there are modules involved, with the
few strokes left there's often still enough extra room to do something
original (remember Eugene's reverse in the Santa golf).

In my case I started with a "normal" solution, I didn't even think of strtol.
My grep in the complete perl sources on "36" then hit strtol. In the
post-mortem you can see that I at first didn't realise that it was exported
by default, so that had me using things like ' to qualify the package and
weird exporter tricks. After a bit of time I by accident found strtol is
exported, and i had a 33 solution. 

But it's not over then. now you basically have to solve the problem:
give strtol scalar context and tag on a \n. I pretty soon found both the
basic 33-solutions by permuting ways to do that a bit. Again it's a bit of
a coincidence that these two methods produce the same result.

In fact, there's an almost 32 solution:

-l use POSIX;print-strtol-pop,36

which fails on a stderr message and does not work on arguments that start
with a number and contain a letter. But it has to be tried at least. How
many of the 33 people did ?

Another approach is to find a module that itself includes POSIX, and then
write something like, say,

-l no IO;print~~IO'strtol pop,36

Unfortunately all modules that load POSIX have very long names, and this 
would need a two-letter name or less.

Another thing I tried is to load it from the commandline. -M doesn't work,
but -d: does. unfortunately it looks in the wrong place, and you can't
easily get it to back up one directory.

So to me even the module solution involved:

- thinking of it at all or finding it (remember, most people didn't)
- realising it's exported
- trying ways to get scalar context and the \n tagged on (the two basic
  ways unfortunately happen to be equal length)
- finding alternative ways of loading the module

In general I would expect even module solutions to show more "spread" than
this one has. The framers of the competetion where just unlucky in that they
hit a task that's almost exactly solved by a module function, and that the
variations that are possible even in such a case here just didn't distinguish
among players enough. Normally the length of "use module" will exclude them
anyways unless they are extremely applyable.

Executive summary: I'm in favor of allowing modules

Reply via email to