in reply to (particle) Re: Re: Efficiently Extracting a Range of Lines (was: Range This)
in thread Efficiently Extracting a Range of Lines (was: Range This)

particle, I overlooked your solution on purpose ;-). That has absolutely nothing to do with the quality - all of them work fine on single START/END tags.

I just was not sure how quick index in comparison to the regex solutions works. The other two are both regex and thus easy to compare. I thought index should be quicker than a regex on a fixed string:

$i = index $stuff, 'START'; # compared to $stuff =~ /START/;
but the benchmark suggested otherwise. The difference might be because of the function overhead and the surrounding code in your solution. But I was too lazy to test this with some proper benchmarks ...

-- Hofmator