Update: The golf dream team of
Ton Hospel, Eugene van der Pijll, Mtv Europe and Keith C Ivey
whittled 15 strokes from my initial offering:
#!perl -l
$_=$"x2**(pop||4);s'$'/\\',print,s/(?<=\\)../$&^aD^n8/egwhile+s\^ \\
Here are some other solutions (without default argument)
they concocted during their fidgeting:
$_=$"x(1<<pop);print,s/(?<=\\)../$&^"\17|"/egwhile+s^\n?$^/\\\n^,s\^ \
+\
$_=$"x(1<<pop).$/;print,s/(?<=\\)../$&^"\17|"/egwhile+s^$^/\\^,s\^ \\
-lX $_=$"x2**pop;print,s/(?<=\\)../$&^"\17|"/egwhile+s*$*/\\**s+^ ++
-lX $_=$"x2**pop;print,s/(?<=\\)../$&^"\17|"/egwhile+s-^ (.*)-$+/\\-
-l $_=$"x2**pop;s'$'/\\',print,s/(?<=\\)../$&^"\17|"/egwhile+s\^ \\
-l $_=$"x2**pop;s'$'/\\',print,s/(?<=\\)../$&^aD^n8/egwhile+s\^ \\
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.