Apache-ProxyRewrite
view release on metacpan or search on metacpan
ProxyRewrite.pm view on Meta::CPAN
my ($lessthanpos, $greaterthanpos, $prediff, $diff,
$preblock, $tagblock, $lastblock);
my $pos = 0;
my $newbuf = '';
my $iscomment = 0;
my $buflen = length($buf);
while (($lessthanpos = index($buf, "<", $pos)) > -1) {
# Make a special case out of the comment in case there
# are nested tags within the comment, such as javascript code
# fragments. Not necessarily our problem, but it doesn't hurt much
# to deal with it.
if (substr($buf, $lessthanpos + 1, 3) eq '!--') {
$greaterthanpos = index($buf, "-->", $lessthanpos);
$iscomment = 1;
} else {
$greaterthanpos = index($buf, ">", $lessthanpos);
}
$prediff = $lessthanpos - $pos;
$diff = $greaterthanpos - $lessthanpos - 1;
$preblock = substr($buf, $pos, $prediff + 1);
( run in 0.785 second using v1.01-cache-2.11-cpan-b16cb0d3907 )