| 1 | package WWW::Chain::UA::LWP; | ||||||||||||||||||||||||||||
| 2 | 5 | our $VERSION = '0.101'; | |||||||||||||||||||||||||||
| 3 | 5 | our $AUTHORITY = 'cpan:GETTY'; | |||||||||||||||||||||||||||
| 4 | # ABSTRACT: Using LWP::UserAgent to execute WWW::Chain chains | ||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 5 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 5 | extends 'LWP::UserAgent'; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 5 | with qw( WWW::Chain::UA ); | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 5 | ▶ | use HTTP::Cookies; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 5 | ▶ | use Scalar::Util 'blessed'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | 5 | ▶ | use Safe::Isa; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 2 | ▶ | sub request_chain { | ||||||||||||||||||||||||||
|
Subroutine
request_chain: called CC=6 SCAR=18.4
Pod
undocumented
| |||||||||||||||||||||||||||||
| 16 | 2 | my ( $self, $chain ) = @_; | |||||||||||||||||||||||||||
| 17 | 2 | ▶ | die __PACKAGE__."->request_chain needs a WWW::Chain object as parameter" | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
builtin::blessed($chain) and $chain->$WWW::Chain::UA::LWP::_isa("WWW::Chain")
MC/DC0%0/2
builtin::blessed($chain) and $chain->$WWW::Chain::UA::LWP::_isa("WWW::Chain")
builtin::blessed($chain)
$chain->$WWW::Chain::UA::LWP::_isa("WWW::Chain")
Truth table33%1/3
A and B
A= builtin::blessed($chain)B= $chain->$WWW::Chain::UA::LWP::_isa("WWW::Chain")
| |||||||||||||||||||||||||||||
| 18 | unless ( blessed($chain) && $chain->$_isa('WWW::Chain') ); | ||||||||||||||||||||||||||||
| 19 | 2 | ▶ | $self->cookie_jar({}) unless $self->cookie_jar; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 20 | 2 | ▶ | while (!$chain->done) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 21 | 4 | my @responses; | |||||||||||||||||||||||||||
| 22 | 4 | for (@{$chain->next_requests}) { | |||||||||||||||||||||||||||
| 23 | 4 | my $response = $self->request($_); | |||||||||||||||||||||||||||
| 24 | 4 | push @responses, $response; | |||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | 4 | $chain->next_responses(@responses); | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | 2 | return $chain; | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 5 | 1; | |||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | __END__ | ||||||||||||||||||||||||||||