%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/share/doc/libwww-perl/examples/
Upload File :
Create Path :
Current File : //usr/share/doc/libwww-perl/examples/handler-order.pl

#!/usr/bin/perl

use strict;
use warnings;
use feature qw( say );

use LWP::UserAgent;
my $ua = LWP::UserAgent->new;

my @phases = (
    'request_preprepare', 'request_prepare',
    'request_send',       'response_header',
    'response_data',      'response_done',
    'response_redirect',
);

for my $phase (@phases) {
    $ua->add_handler($phase => sub { say "$phase"; return undef; });
}

$ua->get('http://example.com');

Zerion Mini Shell 1.0