/usr/share/perl5/WWW/Shorten/UserAgent.pm is in libwww-shorten-perl 3.04-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | package WWW::Shorten::UserAgent;
use strict;
use warnings;
use base 'LWP::UserAgent';
=head1 NAME
WWW::Shorten::UserAgent - LWP::UserAgent subclass for WWW::Shorten modules.
=head1 SYNOPSIS
use WWW::Shorten::UserAgent;
my $ua = WWW::Shorten::UserAgent->new;
my $resp = eval {
$ua->get($url);
};
=head1 DESCRIPTION
Subclass of LWP::UserAgent which works the same way as the supoerclass
except that it throws an exception if the C<get> or C<post> method returns
an error.
See L<LWP::UserAgent> for the full documentation.
=head1 METHODS
=head2 get
Makes an HTTP GET request and throws an exception on error.
=cut
sub get {
my $self = shift;
my $resp = $self->SUPER::get(@_);
die $resp->status_line if $resp->is_error;
return $resp;
}
=head2 post
Makes an HTTP POST request and throws an exception on error.
=cut
sub post {
my $self = shift;
my $resp = $self->SUPER::post(@_);
die $resp->status_line if $resp->is_error;
return $resp;
}
1;
=head1 LICENCE AND COPYRIGHT
Copyright (c) Magnum Solutions Ltd., 2012. All rights reserved.
This module is free software. You can redistribute it and/or
modify it under the terms of the Artistic License 2.0.
This program is distributed in the hope that it will be useful,
but without any warranty; without even the implied warranty of
merchantability or fitness for a particular purpose.
=head1 AUTHOR
Dave Cross <dave@mag-sol.com>
=cut
|