Perl version number puzzlesby xdg (Monsignor)
|on Jun 01, 2009 at 02:40 UTC
(I posted this on my blog to keep up with my Iron Man quota, but since I got no comments there, I decided to re-post it here where I know people enjoy a good Perl puzzle.)
I'm working on a longer article about version numbers in Perl, why there are now so many ways to screw them up, and some recommendations. In the meantime, I realized that some of my examples for that article might be a fun puzzle for others with some curiosity and time to kill.
Each puzzle consists of the output of several Perl one-liners using different versions of Perl. They are run in a directory with a single file, Foo.pm, like this:
In each puzzle, line 4 (the $VERSION line) is different and the puzzle is to figure out the $VERSION line given only the sample output.
N.B. This puzzle intentionally requests a higher version number than is in Foo.
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.