On Thu, 29 Dec 2005, Bob Showalter wrote:
> Jeff Pang wrote:
> > Hi,bob,
> >
> > You said:
> >
> > 3. It will probably be faster to use a single regex of the format:
> >
> > /pata|patb|patc|patd/
> >
> >
> > In fact maybe you are wrong on this.
>
> Darn. First time this year :-)
>
> >
Jeff Pang wrote:
Hi,bob,
You said:
3. It will probably be faster to use a single regex of the format:
/pata|patb|patc|patd/
In fact maybe you are wrong on this.
Darn. First time this year :-)
Based on my test case,the RE written as below:
/pata/ || /patb/ || /patc/ || /patd/
is mu
-
>From: Bob Showalter <[EMAIL PROTECTED]>
>Sent: Dec 29, 2005 2:54 AM
>To: Jeff Pang <[EMAIL PROTECTED]>
>Cc: beginners@perl.org
>Subject: Re: why a.pl is faster than b.pl
>
>Jeff Pang wrote:
>> hi,lists,
>>
>> I have two perl scripts as following:
&g
Jeff Pang wrote:
hi,lists,
I have two perl scripts as following:
a.pl:
#!/usr/bin/perl
use strict;
my @logs = glob "~/logs/rcptstat/da2005_12_28/da.127.0.0.1.*";
foreach my $log (@logs) {
open (HD,$log) or die "$!";
while(){
if (
($_ =~ /×¢²á/o) ||
($_ =~ /Õ÷ÎÄ/o) ||
($_ =~ /
On Wed, 28 Dec 2005, Jeff Pang wrote:
> Why the a.pl is faster than b.pl? I think ever the resulte should be
> opposite.Thanks.
The easiest way to answer such questions is to benchmark and profile
where the time in each script is being spent.
These two scripts are so different in composition t
hi,lists,
I have two perl scripts as following:
a.pl:
#!/usr/bin/perl
use strict;
my @logs = glob "~/logs/rcptstat/da2005_12_28/da.127.0.0.1.*";
foreach my $log (@logs) {
open (HD,$log) or die "$!";
while(){
if (
($_ =~ /â²á/o) ||
($_ =~ /Ã÷ÃÃ/o) ||
($_ =~ /Ã¥µ®¿ìÃÃ/)