| 1 | package HTTP::Proxy::BodyFilter::htmlparser; | ||||||||||
| 2 | 2 | $HTTP::Proxy::BodyFilter::htmlparser::VERSION = '0.304'; | |||||||||
| 3 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 2 | ▶ | use HTTP::Proxy::BodyFilter; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 2 | ▶ | use vars qw( @ISA ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 2 | @ISA = qw( HTTP::Proxy::BodyFilter ); | |||||||||
| 8 | |||||||||||
| 9 | 3 | ▶ | sub init { | ||||||||
|
Subroutine
init: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 10 | 3 | ▶ | croak "First parameter must be a HTML::Parser object" | ||||||||
|
Branch: 1 branch
| |||||||||||
| 11 | unless $_[1]->isa('HTML::Parser'); | ||||||||||
| 12 | |||||||||||
| 13 | 2 | my $self = shift; | |||||||||
| 14 | 2 | $self->{_parser} = shift; | |||||||||
| 15 | |||||||||||
| 16 | 2 | my %args = (@_); | |||||||||
| 17 | 2 | $self->{rw} = delete $args{rw}; | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 2 | ▶ | sub filter { | ||||||||
|
Subroutine
filter: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 21 | 2 | my ( $self, $dataref, $message, $protocol, $buffer ) = @_; | |||||||||
| 22 | |||||||||||
| 23 | 2 | @{ $self->{_parser} }{qw( output message protocol )} = | |||||||||
| 24 | ( "", $message, $protocol ); | ||||||||||
| 25 | |||||||||||
| 26 | 2 | $self->{_parser}->parse($$dataref); | |||||||||
| 27 | 2 | ▶ | $self->{_parser}->eof if not defined $buffer; # last chunk | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | 2 | ▶ | $$dataref = $self->{_parser}{output} if $self->{rw}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 0 | ▶ | sub will_modify { $_[0]->{rw} } | ||||||||
|
Subroutine
will_modify: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 32 | |||||||||||
| 33 | 2 | 1; | |||||||||
| 34 | |||||||||||
| 35 | __END__ | ||||||||||