[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [Fun With Perl] A prime example




On Thu, 10 Jun 1999, Mark-Jason Dominus wrote:

> > > sub f{(1x shift)!~/^(11+)\1+$/}
> > 
> > I don't know what that last '+' was doing in your regexp.
> 
> If it isn't there, then the regex will not match when the argument is
> 21, although it should do.  It becomes a function for recognizing odd
> numbers, which is substantially less interesting than what it was
> before you tampered with it.

Ah, right. Silly me.

Well, I did manage to get it one character shorter... :-)


==== Want to unsubscribe from this list? (Don't you love us anymore?)
==== Well, if you insist... Send mail with body "unsubscribe" to
==== fwp-request@technofile.org