XP is just a number | |
PerlMonks |
Re: Re: Re: Progressive pattern matchingby tfrayner (Curate) |
on Oct 17, 2001 at 17:25 UTC ( [id://119393]=note: print w/replies, xml ) | Need Help?? |
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
In Section
Seekers of Perl Wisdom
|
|