On Wednesday 28 May 2008 04:37:43 James Keenan via RT wrote: > On Tue May 27 20:23:21 2008, [EMAIL PROTECTED] wrote:
> > Why are there four separate test files? It makes more sense to me to > > combine them into a single test file; I'm not sure why there's such a > > proliferation of multiple test files for files being tested. > > Since the usage of the program is to search for a single pattern, the > regex for the search is optimized to compile once: > > $paras[$i] =~ /^=item\sB<(\w*$pattern\w*)>\(([^)]*)\)/o > > I found that if I tried to do test two different patterns in one test > file, I would only get the results of the first. Hence, each of the > test files simulates a different situation. Okay, that's fixable. If you *really* need to optimize this regex, use qr//, as it generally works better than /o. (Post 5.8, as I understand it, /o is almost never useful.) Besides that, it's unlikely that this optimization will have any notable effect in runtime: this is a command-line application run against a handful of ops files which right now have a combined length of 8793 lines. With qr//, the compiled regex is not in the optree, and we don't have an effective global variable which we can't reset without pulling out the B:: modules. Can you combine the test files then? -- c