[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

RE: [FWP] Recursion, anyone?




> In another direction, I wrote one that prints all words of 
> 1-3 characters
> made only by lowercase letters. It goes like:
> 
>     perl -le'$x="a";while(length$x<4){print$x++}'
> 
> For longer words, change 4 to (whatever the maximum length of 
> words)+1.
> This code uses a magic behaviour of the ++ operation. See perlop on
> ++ if you can't understand this.

I applaud you.

Fortunately, I am saved from my never posting promise because your one
liner, while lovely and impressive, only prints alpha's, not whatever you
want to put in the element set as mine does.  I am sure your example
illustrates some optimizations I could incorporate, which I will now think
about <sound of mind switching to 'ON'>.

Eric

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe