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

Re: [Omaha.pm] (?:pattern)



On Oct 21, 2010, at 9:32 AM, Jay Hannah wrote:

> Since the author isn't using the backreferences anyway, why not just
> 
>   /^INS_(CHC|CRS|PLV)$/
> 
> Isn't that the same thing and easier to read?
> 
> I should probably write some little programs to test it, but I'm feeling lazy.  :)

There's presumably a speed-up because it's not dumping the match into $1.  You'd have to benchmark to find out just how much it's saving.

The bigger change is getting rid of the outer grouping parens which are not even needed for grouping.

xoox,
Andy

--
Andy Lester => andy@petdance.com => www.techworklove.com => AIM:petdance