in reply to Re: Re: Reducing Array Interations
in thread Reducing Array Interations
my @tmp; my %text_remove = map {$_=>1} @text_remove; for (@xlate_data) { s/^(\[TEXT\-\d+\])//; $text_remove{$1} ? $tmp[-1] .= "$_" : push(@tmp,"$1$_"); } @xlate_data = @tmp;
Here, we grab the tag off the front and compare it with a hash of the "special" tags. This should be much quicker than running a gigantic pattern against the data.
-Blake
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Reducing Array Interations
by THRAK (Monk) on Aug 17, 2001 at 15:53 UTC |