note
Jenda
<p>You said you build the regex and pass it to the program as a parameter ... how do you use it then?</p>
<code>
my $regexp = @ARGV[1];
...
next if ($global =~ /$regexp/);
...
</code>
<code>
my $regexp = @ARGV[1];
...
next if ($global =~ /$regexp/o);
...
</code>
<code>
my $regexp = qr/@ARGV[1]/;
...
next if ($global =~ $regexp);
...
</code>
<p>The first version compiles the regexp each time you use it, the other two just once. For a longer regexp this may make a big difference.</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-105128">
<p>Jenda<br>
<b>Enoch was right!</b><br/>
Enjoy the last years of Rome.
</p>
</div></div>
1006062
1006062