<?xml version="1.0" encoding="windows-1252"?>
<node id="716510" title="Re: Generate the perl sequence 1, 11, 111, ...." created="2008-10-10 15:48:27" updated="2008-10-10 15:48:27">
<type id="11">
note</type>
<author id="699288">
JavaFan</author>
<data>
<field name="doctext">
Such a home work assignment should immediately trigger the term 'recursion'. The best way to impress your teacher is:
&lt;code&gt;
perl -E'sub _{push@_,say@_;&amp;_}_'
&lt;/code&gt;
It even starts with &lt;b&gt;0&lt;/b&gt; 1's, for extra credits.
&lt;p&gt;
If you want to golf, you might want to try
&lt;code&gt;
perl -E'{$_.=say;redo}'
&lt;/code&gt;</field>
<field name="root_node">
716367</field>
<field name="parent_node">
716367</field>
</data>
</node>
