in reply to Re: Twiddle
in thread Twiddle

Amazing! Especially the  ^/ to force backtrack on failure. And of course, the obligatory 1-liner:
> perl -le'$_=pop;/^(.+?)(?{print$1})$/;/^(.+).(?{print$1})^/' hello h he hel hell hello hell hel he h >
  p

Replies are listed 'Best First'.
Re: Re: Re: Twiddle
by Siggy (Novice) on Jul 13, 2001 at 04:34 UTC
    Thanks all, I'm just learning perl, and that was my first attempt at a program in this language. I'll keep your suggestions in mind. Siggy