develooper Front page | perl.golf | Postings from November 2007

Re: Just chipping in...

Thread Previous | Thread Next
From:
Jasper
Date:
November 23, 2007 04:02
Subject:
Re: Just chipping in...
Message ID:
81cd84130711230402g280783b0g71df8531c9b0bf36@mail.gmail.com
On 20/11/2007, Tuomo Salo <bass@iki.fi> wrote:
> This one has no performance issues and is even a little bit shorter. Yay!
>
> #!perl -l
> $r=qr/\((??{$r})*\)/;map/^$r+$/&&print,glob"{(,)}"x2x pop


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
-- 
Jasper

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About