On Thursday, July 11, 2002, at 03:51 , Jenda Krynicky wrote:
[..]
>
> This may be written
>
> ($first_part_of_line, $second_part_of_line)
> = split(/endnhere/,2);
>
>> Or:
>>
>> $line=~/(.*?)endnhere(.*);
>> $first_part_of_line = $1;
>> $second_part_of_line = $2;
>>
>> Which is quickest? I am using this method repeatedly in my
>> script, so I wanted the quickest method.
[..]
likewise that bit could be written
my ($first_part_of_line, $second_part_of_line) =
($1, $2) if $line=~/(.*)endnhere(.*)/;
one of the benchmarks we ran on
regEx v. Split is
http://www.wetware.com/drieux/pbl/Other/BenchMarks/split_v_Re.txt
and the delta's didn't seem to be that significant.
in this case it appears to be significant
http://www.wetware.com/drieux/pbl/Other/BenchMarks/split_v.re_for_RTF.txt
ciao
drieux
---
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]