2010/1/9 C.DeRykus :
> On Jan 5, 12:13 am, moonb...@gmail.com (Erez Schatz) wrote:
>> 2010/1/5 Jeff Peng :
>> ...
>>
>> This is something that Perl (post version 5.6) does inherently, which
>> is compiling a regex only once as long as the pattern isn't modified.
>
>> Prior to 5.6 you'd need to use
On Jan 5, 12:13 am, moonb...@gmail.com (Erez Schatz) wrote:
> 2010/1/5 Jeff Peng :
> ...
>
> This is something that Perl (post version 5.6) does inherently, which
> is compiling a regex only once as long as the pattern isn't modified.
> Prior to 5.6 you'd need to use the /o modifier (
> m/href="h
On Jan 5, 12:13 am, moonb...@gmail.com (Erez Schatz) wrote:
> 2010/1/5 Jeff Peng :
>
> ...
> This is something that Perl (post version 5.6) does inherently, which
> is compiling a regex only once as long as the pattern isn't modified.
> Prior to 5.6 you'd need to use the /o modifier (
> m/href="ht
Dr.Ruud wrote:
Jeff Peng wrote:
Can the code (specially the regex) below be optimized to run faster?
#!/usr/bin/perl
for ($i=0; $i<1000; $i+=1) {
open HD,"index.html" or die $!;
while() {
print $1,"\n" if /href="http:\/\/(.*?)\/.*" target="_blank"/;
}
close HD;
}
Let me first "normal
Jeff Peng wrote:
Can the code (specially the regex) below be optimized to run faster?
#!/usr/bin/perl
for ($i=0; $i<1000; $i+=1) {
open HD,"index.html" or die $!;
while() {
print $1,"\n" if /href="http:\/\/(.*?)\/.*" target="_blank"/;
}
close HD;
}
Let me first "normalize" the code.
Jeff Peng wrote:
Hello,
Hello,
Can the code (specially the regex) below be optimized to run faster?
#!/usr/bin/perl
for ($i=0; $i<1000; $i+=1) {
++$i is usually faster than $i+=1. But you are not using the $i
variable so you don't really need it (your Ruby programs don't have it.)
for
2010/1/5 Jeff Peng :
> Hello,
>
> Can the code (specially the regex) below be optimized to run faster?
>
> #!/usr/bin/perl
> for ($i=0; $i<1000; $i+=1) {
>
> open HD,"index.html" or die $!;
> while() {
> print $1,"\n" if /href="http:\/\/(.*?)\/.*" target="_blank"/;
> }
> close HD;
> }
theore
> "JP" == Jeff Peng writes:
JP> Hello,
JP> Can the code (specially the regex) below be optimized to run faster?
we seem to be getting a bunch of these questions which i would say are
not beginner's questions. please post this to usenet or perlmonks which
do regex optimizations all the ti