Skip Menu |

This queue is for tickets about the Regexp-Assemble CPAN distribution.

Report information
The Basics
Id: 31045
Status: resolved
Priority: 0/
Queue: Regexp-Assemble

People
Owner: Nobody in particular
Requestors: thomas.burg [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Questions about stats
Date: Thu, 29 Nov 2007 00:31:57 +0100
To: bug-regexp-assemble [...] rt.cpan.org
From: "Thomas Burg" <thomas.burg [...] gmail.com>
Hello, Sorry, it's not a bug. Just a question. I didn't find another way to contact authors ... i follow the presentation of Aaron Crane at the last perl workshop in France. He present your module Regexp::Assemble in order to increase performance on log scanner based on several regexp. Fine, i was facing this issue ;-) My usage is to analyse a log in order to dertermine the result of the test (PASS/FAIL). My test generate sometime 1Gbyte of log, i have a list of regex with capture part to produce a summup log file. This tiny-log should report when some pattern are present. And it should also report when some pattern are missing : " a specific message is missing". As i didn't find in the manuel this kind of feature : collect stats on pattern matched in oder to say "this pattern never appear", i ask you : is there a way to do this inside the module in version 0.32 ? (i am using perl 5.8 ) Regards Thomas
Subject: Re: [rt.cpan.org #31045] Questions about stats
Date: Thu, 29 Nov 2007 14:08:02 +0100
To: bug-Regexp-Assemble [...] rt.cpan.org
From: David Landgren <david [...] landgren.net>
Thomas Burg via RT wrote: Show quoted text
> Wed Nov 28 18:32:32 2007: Request 31045 was acted upon. > Transaction: Ticket created by thomas.burg@gmail.com > Queue: Regexp-Assemble > Subject: Questions about stats > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: thomas.burg@gmail.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=31045 > > > > Hello, > > Sorry, it's not a bug. Just a question. I didn't find another way to > contact authors ...
No problem, this is as good a venue as any. Show quoted text
> As i didn't find in the manuel this kind of feature : collect stats on > pattern matched in oder to say "this pattern never appear", i ask you > : is there a way to do this inside the module in version 0.32 ?
Hmm. You could be scanning through up to a gigabyte of log? I guess that precludes slurping it all into memory... I think you are going to have to say something like: my $must_match = Regexp::Assemble->new(...); my $must_not_match = Regexp::Assemble->new(...); my $want_report = 1; my @report; while (<$log>) { /$must_match/ and push @report, $_; if (!/$must_not_match/) { $want_report = 0; last; } } if (@report and $want_report) { process(@report); } I think that to try and push $must_match and $must_not_match together is just going to make you want to poke your eyes out. As long as your patterns don't start with too many things like .* or .+ you should have problems with efficiency. Without knowing more about what matches and what doesn't. I don't know if I can offer better advice. There's a mailing list (regexp-assemble-subscribe@mongueurs.net) if you're interested (although there are only a dozen or so subscribers at the moment). Regards, David
In absence of follow-up information, I'm closing this ticket. Feel free to reopen it if you want. Thanks, David