Hello natol44,
Have you looked at the 3rd optional parameter of 'index'. 'index' is very fast and since you have a large string, you can loop until the end by starting the next search('index') with the end of the most recent end of your search.
(untested code):
my $pos = 0;
while ( $pos < length( $all ) )
{ my $si = index ( $all, "<START>", $pos );
if ( $si < 0 ) { last; }
my $sj = index ( $all, "<END>", $si+1 );
if ( $sj > $si+1 )
{ ... Collect you string with 'substr' etc.
}
$pos = $sj + 4; # set search for finding next text.
}
Note: There are working examples in the Perl Cookbook and also using Super Search.
Regards...Ed
"Well done is better than well said." - Benjamin Franklin