Re: Some random reflections on tpr05a

[email protected] (Michael W Thelen)
Newsgroups perl.golf
Message-ID <[email protected]>
On Mon, Sep 09, 2002 at 05:05:45AM -0700, Greg Allen wrote:
> well impressed by some of Eugene's tricks. is this first use seen in golf of
> /[@_^abc]/ or similar use of a variable toggle the meaning of the ^ ?

That is very clever.  I can't remember seeing it before, but I'm also a
relative newcomer.

In one of my solutions (123.64), I was happy to think of something similar...
using $: (which contains " \n-" by default) inside a character class, so that
the meaning of the "-" would be alternately a range or a literal "-" depending
on the contents of another variable ($z):

-lp y/ 	//d+s@\(|(?<=[\d)])\D@$z=!/\G[+-]/&&'"';($"=" $&$\"")=~s+\)(.*?)\(|([^ (])([*/$:$z]*)+$2 +;$+@eg;$_.=$";y/ //s+chop

Just for posterity, when I get a little free time, I'll write up an analysis of
my final 112 solution (which will force me to try and understand it myself:).

-- Mike

-- 
Michael W. Thelen
eval unpack u,'M*"1C/2<P,BDN-"`U+C`A(RLG*3U^>2\A+48O82UZ+SME=F%L*"1C+B(G=2HGM+"
<Z,D<U4SU<(B%!.T9=5#HF-5(H)2%%/$907$`Z)B5#.E8U4BM@2&`G+EPD$+R(I.P``'
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.