use strict;
use warnings;
no warnings "void";

=head1 NAME

LWP::UserAgent::Paranoid::Compat - LWP::UserAgent::Paranoid drop-in replacement
for LWPx::ParanoidAgent


package LWP::UserAgent::Paranoid::Compat;
use base 'LWP::UserAgent::Paranoid';


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

    # use $ua the same as LWPx::ParanoidAgent...


This class is a subclass of L<LWP::UserAgent::Paranoid> and changes the default
behaviour and interface to match L<LWPx::ParanoidAgent> as closely as possible.

=head2 Differences from L<LWP::UserAgent::Paranoid>


=item * Only HTTP and HTTPS are allowed

=item * Timeout is 15s by default

=item * A C<timeout> constructor param and L</timeout> method are available

=item * The L</resolver> method gets/sets the underlying resolver used by an
L<Net::DNS::Paranoid> instance instead of acting as the getter of the
L<Net::DNS::Paranoid> instance itself.  The C<resolver> constructor param
follows suite.



sub new {
    my ($class, %opts) = @_;

    # LWPx::ParanoidAgent uses 'timeout' instead of a separate
    # 'request_timeout' and a default of 15s instead of 5s.
    $opts{timeout}         ||= 15;
    $opts{request_timeout} ||= $opts{timeout};

    # Resolver is used to set the Net::DNS::Paranoid resolver
    my $resolver = delete $opts{resolver};

    my $self = $class->SUPER::new(%opts);

    # LWPx::ParanoidAgent limits to http/https by default.
    $self->protocols_allowed(["http", "https"]);
        if $resolver;

    return $self;

sub timeout {
    my $self = shift;
    $self->_elem("timeout", @_);

sub resolver {

"The truth is out there.";

=head1 BUGS

All bugs should be reported via
or L<>.

=head1 AUTHOR

Thomas Sibley <>

This software is primarily Copyright (c) 2013 by Best Practical Solutions,
with parts of it Copyright (c) 2014-2015 by Thomas Sibley.
This is free software, licensed under:
  The GNU General Public License, Version 2, June 1991