http://www.perlmonks.org?node_id=119393


in reply to Re: Re: Progressive pattern matching
in thread Progressive pattern matching

Heh - nice.

I knew there must be a shorter solution. I won't comment on whether it's simpler, but I know which I think is more readable :-). However, I note that your solution is in fact technically a little more complete than mine. My script misses substrings that aren't at the end of matches (i.e. will match GLY in SPRIGLY but not SPR). Neither script matches PRI, RIG or IGL in the above.

Although why you might want to do this (save for the sake of programming elegance) I'm not sure :-P

About my only contribution (since it's going to take me a little while to fully comprehend the golf) is that the @c array appears to be dispensable.

Tim