On 23/11/2007, Jasper <[EMAIL PROTECTED]> wrote: > Just thought of this. > > Probably has performance issues and is a little bit longer. Boo! > > #!perl -l > $l=2*pop;fork?$l>$c++?$_.='(':exit:$c--?$_.=')':exit while$l--;print > > Doesn't order correctly (it would if I added a wait), doesn't print > right, but everyone loves potentially killing their machine with a > fork. Can't get rid of the two exits, so there seems to be flab for > sure
Flabby indeed #!perl -l $_.=fork?$c--?')':exit:++$c&&'('for($_)x(2*pop);$c||print That's the same length as bass, but still with the same problems. A waitpid does solve the ordering problem, but the only way to stop the overall parent exiting before all the permutations have printed is to do something awful. Those solutions add lotsa characters... :( -- Jasper