summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2020-12-10 09:15:51 -0500
committerJames E Keenan <jkeenan@cpan.org>2020-12-10 09:17:48 -0500
commit27b896ab16fc64a09f58afd0fe103a277bd526fd (patch)
tree27057c467ea0ccec00247174515d16500d2b9856
parent5c5e39febd38425fd9d6f8b59a43835d43928530 (diff)
downloadperl-27b896ab16fc64a09f58afd0fe103a277bd526fd.tar.gz
Synch with CPAN distribution libnet-3.12
-rw-r--r--MANIFEST1
-rwxr-xr-xPorting/Maintainers.pl2
-rw-r--r--cpan/libnet/Makefile.PL6
-rw-r--r--cpan/libnet/lib/Net/Cmd.pm145
-rw-r--r--cpan/libnet/lib/Net/Config.pm56
-rw-r--r--cpan/libnet/lib/Net/Domain.pm67
-rw-r--r--cpan/libnet/lib/Net/FTP.pm336
-rw-r--r--cpan/libnet/lib/Net/FTP/A.pm2
-rw-r--r--cpan/libnet/lib/Net/FTP/E.pm2
-rw-r--r--cpan/libnet/lib/Net/FTP/I.pm2
-rw-r--r--cpan/libnet/lib/Net/FTP/L.pm2
-rw-r--r--cpan/libnet/lib/Net/FTP/dataconn.pm75
-rw-r--r--cpan/libnet/lib/Net/NNTP.pm307
-rw-r--r--cpan/libnet/lib/Net/Netrc.pm59
-rw-r--r--cpan/libnet/lib/Net/POP3.pm141
-rw-r--r--cpan/libnet/lib/Net/SMTP.pm195
-rw-r--r--cpan/libnet/lib/Net/Time.pm63
-rw-r--r--cpan/libnet/lib/Net/libnetFAQ.pod16
-rw-r--r--cpan/libnet/t/config.t21
-rw-r--r--cpan/libnet/t/datasend.t16
-rw-r--r--cpan/libnet/t/ftp.t2
-rw-r--r--cpan/libnet/t/hostname.t6
-rw-r--r--cpan/libnet/t/libnet_t.pl41
-rw-r--r--cpan/libnet/t/netrc.t15
-rw-r--r--cpan/libnet/t/nntp.t13
-rw-r--r--cpan/libnet/t/nntp_ipv6.t12
-rw-r--r--cpan/libnet/t/nntp_ssl.t12
-rw-r--r--cpan/libnet/t/pop3_ipv6.t12
-rw-r--r--cpan/libnet/t/pop3_ssl.t12
-rw-r--r--cpan/libnet/t/require.t4
-rw-r--r--cpan/libnet/t/smtp.t15
-rw-r--r--cpan/libnet/t/smtp_ipv6.t12
-rw-r--r--cpan/libnet/t/smtp_ssl.t12
-rw-r--r--cpan/libnet/t/time.t16
34 files changed, 1022 insertions, 676 deletions
diff --git a/MANIFEST b/MANIFEST
index 5aab31f3dc..6ac7ad47ee 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1275,7 +1275,6 @@ cpan/libnet/t/config.t libnet
cpan/libnet/t/datasend.t libnet
cpan/libnet/t/ftp.t libnet
cpan/libnet/t/hostname.t libnet
-cpan/libnet/t/libnet_t.pl libnet
cpan/libnet/t/netrc.t libnet
cpan/libnet/t/nntp.t libnet
cpan/libnet/t/nntp_ipv6.t
diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl
index 4f9030c09c..74b930b8ea 100755
--- a/Porting/Maintainers.pl
+++ b/Porting/Maintainers.pl
@@ -693,7 +693,7 @@ use File::Glob qw(:case);
},
'libnet' => {
- 'DISTRIBUTION' => 'SHAY/libnet-3.11.tar.gz',
+ 'DISTRIBUTION' => 'SHAY/libnet-3.12.tar.gz',
'FILES' => q[cpan/libnet],
'EXCLUDED' => [
qw( Configure
diff --git a/cpan/libnet/Makefile.PL b/cpan/libnet/Makefile.PL
index 73be0a1654..477739068d 100644
--- a/cpan/libnet/Makefile.PL
+++ b/cpan/libnet/Makefile.PL
@@ -7,7 +7,7 @@
# Makefile creation script.
#
# COPYRIGHT
-# Copyright (C) 2014, 2015 Steve Hay. All rights reserved.
+# Copyright (C) 2014-2015, 2020 Steve Hay. All rights reserved.
#
# LICENCE
# This script is free software; you can redistribute it and/or modify it under
@@ -66,7 +66,7 @@ MAIN: {
ABSTRACT => 'Collection of network protocol modules',
AUTHOR => 'Graham Barr <gbarr@pobox.com>, Steve Hay <shay@cpan.org>',
LICENSE => 'perl_5',
- VERSION => '3.11',
+ VERSION => '3.12',
META_MERGE => {
'meta-spec' => {
@@ -76,7 +76,7 @@ MAIN: {
resources => {
repository => {
type => 'git',
- url => 'https://github.com/steve-m-hay/perl-libnet.git'
+ web => 'https://github.com/steve-m-hay/perl-libnet'
}
},
diff --git a/cpan/libnet/lib/Net/Cmd.pm b/cpan/libnet/lib/Net/Cmd.pm
index b695f64dd0..650f23be96 100644
--- a/cpan/libnet/lib/Net/Cmd.pm
+++ b/cpan/libnet/lib/Net/Cmd.pm
@@ -1,7 +1,7 @@
# Net::Cmd.pm
#
# Copyright (C) 1995-2006 Graham Barr. All rights reserved.
-# Copyright (C) 2013-2016 Steve Hay. All rights reserved.
+# Copyright (C) 2013-2016, 2020 Steve Hay. All rights reserved.
# This module is free software; you can redistribute it and/or modify it under
# the same terms as Perl itself, i.e. under the terms of either the GNU General
# Public License or the Artistic License, as specified in the F<LICENCE> file.
@@ -26,7 +26,7 @@ BEGIN {
}
}
-our $VERSION = "3.11";
+our $VERSION = "3.12";
our @ISA = qw(Exporter);
our @EXPORT = qw(CMD_INFO CMD_OK CMD_MORE CMD_REJECT CMD_ERROR CMD_PENDING);
@@ -100,7 +100,7 @@ sub _print_isa {
sub debug {
- @_ == 1 or @_ == 2 or croak 'usage: $obj->debug([LEVEL])';
+ @_ == 1 or @_ == 2 or croak 'usage: $obj->debug([$level])';
my ($cmd, $level) = @_;
my $pkg = ref($cmd) || $cmd;
@@ -175,7 +175,7 @@ sub status {
sub set_status {
- @_ == 3 or croak 'usage: $obj->set_status(CODE, MESSAGE)';
+ @_ == 3 or croak 'usage: $obj->set_status($code, $resp)';
my $cmd = shift;
my ($code, $resp) = @_;
@@ -335,15 +335,19 @@ sub getline {
my $rin = "";
vec($rin, $fd, 1) = 1;
+ my $timeout = $cmd->timeout || undef;
+ my $initial = time;
+ my $pending = $timeout;
+
my $buf;
until (scalar(@{${*$cmd}{'net_cmd_lines'}})) {
- my $timeout = $cmd->timeout || undef;
my $rout;
- my $select_ret = select($rout = $rin, undef, undef, $timeout);
- if ($select_ret > 0) {
- unless (sysread($cmd, $buf = "", 1024)) {
+ my $select_ret = select($rout = $rin, undef, undef, $pending);
+ if (defined $select_ret and $select_ret > 0) {
+ my $r = sysread($cmd, $buf = "", 1024);
+ if (! defined($r) ) {
my $err = $!;
$cmd->close;
$cmd->_set_status_closed($err);
@@ -359,6 +363,20 @@ sub getline {
push(@{${*$cmd}{'net_cmd_lines'}}, map {"$_\n"} @buf);
}
+ elsif (defined $select_ret && $select_ret == -1) {
+ if ( $! == EINTR ) {
+ if ( defined($timeout) ) {
+ redo if ($pending = $timeout - ( time - $initial ) ) > 0;
+ $cmd->_set_status_timeout;
+ return;
+ }
+ redo;
+ }
+ my $err = $!;
+ $cmd->close;
+ $cmd->_set_status_closed($err);
+ return;
+ }
else {
$cmd->_set_status_timeout;
return;
@@ -661,59 +679,59 @@ C<IO::Socket::IP>, C<IO::Socket::INET6> or C<IO::Socket::SSL>) then you must
provide the following methods by other means yourself: C<close()> and
C<timeout()>.
-=head1 USER METHODS
+=head2 Public Methods
These methods provide a user interface to the C<Net::Cmd> object.
=over 4
-=item debug ( VALUE )
+=item C<debug($level)>
-Set the level of debug information for this object. If C<VALUE> is not given
+Set the level of debug information for this object. If C<$level> is not given
then the current state is returned. Otherwise the state is changed to
-C<VALUE> and the previous state returned.
+C<$level> and the previous state returned.
Different packages
may implement different levels of debug but a non-zero value results in
copies of all commands and responses also being sent to STDERR.
-If C<VALUE> is C<undef> then the debug level will be set to the default
+If C<$level> is C<undef> then the debug level will be set to the default
debug level for the class.
This method can also be called as a I<static> method to set/get the default
debug level for a given class.
-=item message ()
+=item C<message()>
Returns the text message returned from the last command. In a scalar
context it returns a single string, in a list context it will return
each line as a separate element. (See L<PSEUDO RESPONSES> below.)
-=item code ()
+=item C<code()>
Returns the 3-digit code from the last command. If a command is pending
then the value 0 is returned. (See L<PSEUDO RESPONSES> below.)
-=item ok ()
+=item C<ok()>
Returns non-zero if the last code value was greater than zero and
less than 400. This holds true for most command servers. Servers
where this does not hold may override this method.
-=item status ()
+=item C<status()>
Returns the most significant digit of the current status code. If a command
is pending then C<CMD_PENDING> is returned.
-=item datasend ( DATA )
+=item C<datasend($data)>
Send data to the remote server, converting LF to CRLF. Any line starting
with a '.' will be prefixed with another '.'.
-C<DATA> may be an array or a reference to an array.
-The C<DATA> passed in must be encoded by the caller to octets of whatever
+C<$data> may be an array or a reference to an array.
+The C<$data> passed in must be encoded by the caller to octets of whatever
encoding is required, e.g. by using the Encode module's C<encode()> function.
-=item dataend ()
+=item C<dataend()>
End the sending of data to the remote server. This is done by ensuring that
the data already sent ends with CRLF then sending '.CRLF' to end the
@@ -722,28 +740,28 @@ returns true if C<response> returns CMD_OK.
=back
-=head1 CLASS METHODS
+=head2 Protected Methods
These methods are not intended to be called by the user, but used or
over-ridden by a sub-class of C<Net::Cmd>
=over 4
-=item debug_print ( DIR, TEXT )
+=item C<debug_print($dir, $text)>
-Print debugging information. C<DIR> denotes the direction I<true> being
+Print debugging information. C<$dir> denotes the direction I<true> being
data being sent to the server. Calls C<debug_text> before printing to
STDERR.
-=item debug_text ( DIR, TEXT )
+=item C<debug_text($dir, $text)>
-This method is called to print debugging information. TEXT is
+This method is called to print debugging information. C<$text> is
the text being sent. The method should return the text to be printed.
This is primarily meant for the use of modules such as FTP where passwords
are sent, but we do not want to display them in the debugging information.
-=item command ( CMD [, ARGS, ... ])
+=item C<command($cmd[, $args, ... ])>
Send a command to the command server. All arguments are first joined with
a space character and CRLF is appended, this string is then sent to the
@@ -751,24 +769,24 @@ command server.
Returns undef upon failure.
-=item unsupported ()
+=item C<unsupported()>
Sets the status code to 580 and the response text to 'Unsupported command'.
Returns zero.
-=item response ()
+=item C<response()>
Obtain a response from the server. Upon success the most significant digit
of the status code is returned. Upon failure, timeout etc., I<CMD_ERROR> is
returned.
-=item parse_response ( TEXT )
+=item C<parse_response($text)>
This method is called by C<response> as a method with one argument. It should
return an array of 2 values, the 3-digit status code and a flag which is true
when this is part of a multi-line response and this line is not the last.
-=item getline ()
+=item C<getline()>
Retrieve one line, delimited by CRLF, from the remote server. Returns I<undef>
upon failure.
@@ -776,26 +794,26 @@ upon failure.
B<NOTE>: If you do use this method for any reason, please remember to add
some C<debug_print> calls into your method.
-=item ungetline ( TEXT )
+=item C<ungetline($text)>
Unget a line of text from the server.
-=item rawdatasend ( DATA )
+=item C<rawdatasend($data)>
-Send data to the remote server without performing any conversions. C<DATA>
+Send data to the remote server without performing any conversions. C<$data>
is a scalar.
-As with C<datasend()>, the C<DATA> passed in must be encoded by the caller
+As with C<datasend()>, the C<$data> passed in must be encoded by the caller
to octets of whatever encoding is required, e.g. by using the Encode module's
C<encode()> function.
-=item read_until_dot ()
+=item C<read_until_dot()>
Read data from the remote server until a line consisting of a single '.'.
Any lines starting with '..' will have one of the '.'s removed.
Returns a reference to a list containing the lines, or I<undef> upon failure.
-=item tied_fh ()
+=item C<tied_fh()>
Returns a filehandle tied to the Net::Cmd object. After issuing a
command, you may read from this filehandle using read() or <>. The
@@ -807,7 +825,7 @@ See the Net::POP3 and Net::SMTP modules for examples of this.
=back
-=head1 PSEUDO RESPONSES
+=head2 Pseudo Responses
Normally the values returned by C<message()> and C<code()> are
obtained from the remote server, but in a few circumstances, as
@@ -847,22 +865,47 @@ or otherwise trap this error.
=head1 EXPORTS
-C<Net::Cmd> exports six subroutines, five of these, C<CMD_INFO>, C<CMD_OK>,
-C<CMD_MORE>, C<CMD_REJECT> and C<CMD_ERROR>, correspond to possible results
-of C<response> and C<status>. The sixth is C<CMD_PENDING>.
+The following symbols are, or can be, exported by this module:
+
+=over 4
+
+=item Default Exports
+
+C<CMD_INFO>,
+C<CMD_OK>,
+C<CMD_MORE>,
+C<CMD_REJECT>,
+C<CMD_ERROR>,
+C<CMD_PENDING>.
+
+(These correspond to possible results of C<response()> and C<status()>.)
+
+=item Optional Exports
+
+I<None>.
+
+=item Export Tags
+
+I<None>.
+
+=back
+
+=head1 KNOWN BUGS
+
+See L<https://rt.cpan.org/Dist/Display.html?Status=Active&Queue=libnet>.
=head1 AUTHOR
-Graham Barr E<lt>F<gbarr@pobox.com>E<gt>.
+Graham Barr E<lt>L<gbarr@pobox.com|mailto:gbarr@pobox.com>E<gt>.
-Steve Hay E<lt>F<shay@cpan.org>E<gt> is now maintaining libnet as of version
-1.22_02.
+Steve Hay E<lt>L<shay@cpan.org|mailto:shay@cpan.org>E<gt> is now maintaining
+libnet as of version 1.22_02.
=head1 COPYRIGHT
Copyright (C) 1995-2006 Graham Barr. All rights reserved.
-Copyright (C) 2013-2016 Steve Hay. All rights reserved.
+Copyright (C) 2013-2016, 2020 Steve Hay. All rights reserved.
=head1 LICENCE
@@ -870,4 +913,16 @@ This module is free software; you can redistribute it and/or modify it under the
same terms as Perl itself, i.e. under the terms of either the GNU General Public
License or the Artistic License, as specified in the F<LICENCE> file.
+=head1 VERSION
+
+Version 3.12
+
+=head1 DATE
+
+09 Dec 2020
+
+=head1 HISTORY
+
+See the F<Changes> file.
+
=cut
diff --git a/cpan/libnet/lib/Net/Config.pm b/cpan/libnet/lib/Net/Config.pm
index 4f822a40a4..365cb49b16 100644
--- a/cpan/libnet/lib/Net/Config.pm
+++ b/cpan/libnet/lib/Net/Config.pm
@@ -1,7 +1,7 @@
# Net::Config.pm
#
# Copyright (C) 2000 Graham Barr. All rights reserved.
-# Copyright (C) 2013-2014, 2016 Steve Hay. All rights reserved.
+# Copyright (C) 2013-2014, 2016, 2020 Steve Hay. All rights reserved.
# This module is free software; you can redistribute it and/or modify it under
# the same terms as Perl itself, i.e. under the terms of either the GNU General
# Public License or the Artistic License, as specified in the F<LICENCE> file.
@@ -18,7 +18,7 @@ use Socket qw(inet_aton inet_ntoa);
our @EXPORT = qw(%NetConfig);
our @ISA = qw(Net::LocalCfg Exporter);
-our $VERSION = "3.11";
+our $VERSION = "3.12";
our($CONFIGURE, $LIBNET_CFG);
@@ -159,7 +159,7 @@ For example
}
__END__
-=head1 METHODS
+=head2 Class Methods
C<Net::Config> defines the following methods. They are methods as they are
invoked as class methods. This is because C<Net::Config> inherits from
@@ -167,7 +167,7 @@ C<Net::LocalCfg> so you can override these methods if you want.
=over 4
-=item requires_firewall ( HOST )
+=item C<requires_firewall($host)>
Attempts to determine if a given host is outside your firewall. Possible
return values are.
@@ -181,7 +181,7 @@ the configuration data.
=back
-=head1 NetConfig VALUES
+=head2 NetConfig Values
=over 4
@@ -323,18 +323,42 @@ If true then C<Configure> will check each hostname given that it exists
=back
+=head1 EXPORTS
+
+The following symbols are, or can be, exported by this module:
+
+=over 4
+
+=item Default Exports
+
+C<%NetConfig>.
+
+=item Optional Exports
+
+I<None>.
+
+=item Export Tags
+
+I<None>.
+
+=back
+
+=head1 KNOWN BUGS
+
+I<None>.
+
=head1 AUTHOR
-Graham Barr E<lt>F<gbarr@pobox.com>E<gt>.
+Graham Barr E<lt>L<gbarr@pobox.com|mailto:gbarr@pobox.com>E<gt>.
-Steve Hay E<lt>F<shay@cpan.org>E<gt> is now maintaining libnet as of version
-1.22_02.
+Steve Hay E<lt>L<shay@cpan.org|mailto:shay@cpan.org>E<gt> is now maintaining
+libnet as of version 1.22_02.
=head1 COPYRIGHT
-Copyright (C) 1998-2011 Graham Barr. All rights reserved.
+Copyright (C) 2000 Graham Barr. All rights reserved.
-Copyright (C) 2013-2014, 2016 Steve Hay. All rights reserved.
+Copyright (C) 2013-2014, 2016, 2020 Steve Hay. All rights reserved.
=head1 LICENCE
@@ -342,4 +366,16 @@ This module is free software; you can redistribute it and/or modify it under the
same terms as Perl itself, i.e. under the terms of either the GNU General Public
License or the Artistic License, as specified in the F<LICENCE> file.
+=head1 VERSION
+
+Version 3.12
+
+=head1 DATE
+
+09 Dec 2020
+
+=head1 HISTORY
+
+See the F<Changes> file.
+
=cut
diff --git a/cpan/libnet/lib/Net/Domain.pm b/cpan/libnet/lib/Net/Domain.pm
index 556cc15980..f4c93eafdb 100644
--- a/cpan/libnet/lib/Net/Domain.pm
+++ b/cpan/libnet/lib/Net/Domain.pm
@@ -1,7 +1,7 @@
# Net::Domain.pm
#
# Copyright (C) 1995-1998 Graham Barr. All rights reserved.
-# Copyright (C) 2013-2014 Steve Hay. All rights reserved.
+# Copyright (C) 2013-2014, 2020 Steve Hay. All rights reserved.
# This module is free software; you can redistribute it and/or modify it under
# the same terms as Perl itself, i.e. under the terms of either the GNU General
# Public License or the Artistic License, as specified in the F<LICENCE> file.
@@ -19,7 +19,7 @@ use Net::Config;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(hostname hostdomain hostfqdn domainname);
-our $VERSION = "3.11";
+our $VERSION = "3.12";
my ($host, $domain, $fqdn) = (undef, undef, undef);
@@ -321,40 +321,71 @@ of the current host. From this determine the host-name and the host-domain.
Each of the functions will return I<undef> if the FQDN cannot be determined.
+=head2 Functions
+
=over 4
-=item hostfqdn ()
+=item C<hostfqdn()>
Identify and return the FQDN of the current host.
-=item domainname ()
+=item C<domainname()>
-An alias for hostfqdn ().
+An alias for hostfqdn().
-=item hostname ()
+=item C<hostname()>
Returns the smallest part of the FQDN which can be used to identify the host.
-=item hostdomain ()
+=item C<hostdomain()>
Returns the remainder of the FQDN after the I<hostname> has been removed.
=back
+=head1 EXPORTS
+
+The following symbols are, or can be, exported by this module:
+
+=over 4
+
+=item Default Exports
+
+I<None>.
+
+=item Optional Exports
+
+C<hostname>,
+C<hostdomain>,
+C<hostfqdn>,
+C<domainname>.
+
+=item Export Tags
+
+I<None>.
+
+=back
+
+
+=head1 KNOWN BUGS
+
+See L<https://rt.cpan.org/Dist/Display.html?Status=Active&Queue=libnet>.
+
=head1 AUTHOR
-Graham Barr E<lt>F<gbarr@pobox.com>E<gt>.
+Graham Barr E<lt>L<gbarr@pobox.com|mailto:gbarr@pobox.com>E<gt>.
-Adapted from Sys::Hostname by David Sundstrom E<lt>F<sunds@asictest.sc.ti.com>E<gt>.
+Adapted from Sys::Hostname by David Sundstrom
+E<lt>L<sunds@asictest.sc.ti.com|mailto:sunds@asictest.sc.ti.com>E<gt>.
-Steve Hay E<lt>F<shay@cpan.org>E<gt> is now maintaining libnet as of version
-1.22_02.
+Steve Hay E<lt>L<shay@cpan.org|mailto:shay@cpan.org>E<gt> is now maintaining
+libnet as of version 1.22_02.
=head1 COPYRIGHT
Copyright (C) 1995-1998 Graham Barr. All rights reserved.
-Copyright (C) 2013-2014 Steve Hay. All rights reserved.
+Copyright (C) 2013-2014, 2020 Steve Hay. All rights reserved.
=head1 LICENCE
@@ -362,4 +393,16 @@ This module is free software; you can redistribute it and/or modify it under the
same terms as Perl itself, i.e. under the terms of either the GNU General Public
License or the Artistic License, as specified in the F<LICENCE> file.
+=head1 VERSION
+
+Version 3.12
+
+=head1 DATE
+
+09 Dec 2020
+
+=head1 HISTORY
+
+See the F<Changes> file.
+
=cut
diff --git a/cpan/libnet/lib/Net/FTP.pm b/cpan/libnet/lib/Net/FTP.pm
index 14153be0d0..b195c9c92c 100644
--- a/cpan/libnet/lib/Net/FTP.pm
+++ b/cpan/libnet/lib/Net/FTP.pm
@@ -1,7 +1,7 @@
# Net::FTP.pm
#
# Copyright (C) 1995-2004 Graham Barr. All rights reserved.
-# Copyright (C) 2013-2017 Steve Hay. All rights reserved.
+# Copyright (C) 2013-2017, 2020 Steve Hay. All rights reserved.
# This module is free software; you can redistribute it and/or modify it under
# the same terms as Perl itself, i.e. under the terms of either the GNU General
# Public License or the Artistic License, as specified in the F<LICENCE> file.
@@ -23,7 +23,7 @@ use Net::Config;
use Socket;
use Time::Local;
-our $VERSION = '3.11';
+our $VERSION = '3.12';
our $IOCLASS;
my $family_key;
@@ -110,10 +110,13 @@ sub new {
# use SNI if supported by IO::Socket::SSL
$pkg->can_client_sni ? (SSL_hostname => $hostname):(),
# reuse SSL session of control connection in data connections
- SSL_session_cache => Net::FTP::_SSL_SingleSessionCache->new,
+ SSL_session_cache_size => 10,
+ SSL_session_key => $hostname,
);
# user defined SSL arg
$tlsargs{$_} = $arg{$_} for(grep { m{^SSL_} } keys %arg);
+ $tlsargs{SSL_reuse_ctx} = IO::Socket::SSL::SSL_Context->new(%tlsargs)
+ or return;
} elsif ($arg{SSL}) {
croak("IO::Socket::SSL >= 2.007 needed for SSL support");
@@ -262,7 +265,7 @@ sub mdtm {
$ftp->_MDTM($file)
&& $ftp->message =~ /((\d\d)(\d\d\d?))(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)/
- ? timegm($8, $7, $6, $5, $4 - 1, $2 eq '19' ? $3 : ($1 - 1900))
+ ? timegm($8, $7, $6, $5, $4 - 1, $2 eq '19' ? ($3 + 1900) : $1)
: undef;
}
@@ -426,7 +429,7 @@ sub login {
sub account {
- @_ == 2 or croak 'usage: $ftp->account( ACCT )';
+ @_ == 2 or croak 'usage: $ftp->account($acct)';
my $ftp = shift;
my $acct = shift;
$ftp->_ACCT($acct) == CMD_OK;
@@ -452,7 +455,7 @@ sub _auth_id {
sub authorize {
- @_ >= 1 || @_ <= 3 or croak 'usage: $ftp->authorize( [AUTH [, RESP]])';
+ @_ >= 1 || @_ <= 3 or croak 'usage: $ftp->authorize([$auth[, $resp]])';
my ($ftp, $auth, $resp) = &_auth_id;
@@ -466,12 +469,12 @@ sub authorize {
sub rename {
- @_ == 3 or croak 'usage: $ftp->rename(FROM, TO)';
+ @_ == 3 or croak 'usage: $ftp->rename($oldname, $newname)';
- my ($ftp, $from, $to) = @_;
+ my ($ftp, $oldname, $newname) = @_;
- $ftp->_RNFR($from)
- && $ftp->_RNTO($to);
+ $ftp->_RNFR($oldname)
+ && $ftp->_RNTO($newname);
}
@@ -619,7 +622,7 @@ sub get {
sub cwd {
- @_ == 1 || @_ == 2 or croak 'usage: $ftp->cwd( [ DIR ] )';
+ @_ == 1 || @_ == 2 or croak 'usage: $ftp->cwd([$dir])';
my ($ftp, $dir) = @_;
@@ -656,7 +659,7 @@ sub pwd {
# Initial version contributed by Dinkum Software
#
sub rmdir {
- @_ == 2 || @_ == 3 or croak('usage: $ftp->rmdir( DIR [, RECURSE ] )');
+ @_ == 2 || @_ == 3 or croak('usage: $ftp->rmdir($dir[, $recurse])');
# Pick off the args
my ($ftp, $dir, $recurse) = @_;
@@ -702,7 +705,7 @@ sub rmdir {
sub restart {
- @_ == 2 || croak 'usage: $ftp->restart( BYTE_OFFSET )';
+ @_ == 2 || croak 'usage: $ftp->restart($where)';
my ($ftp, $where) = @_;
@@ -713,7 +716,7 @@ sub restart {
sub mkdir {
- @_ == 2 || @_ == 3 or croak 'usage: $ftp->mkdir( DIR [, RECURSE ] )';
+ @_ == 2 || @_ == 3 or croak 'usage: $ftp->mkdir($dir[, $recurse])';
my ($ftp, $dir, $recurse) = @_;
@@ -758,7 +761,7 @@ sub mkdir {
sub delete {
- @_ == 2 || croak 'usage: $ftp->delete( FILENAME )';
+ @_ == 2 || croak 'usage: $ftp->delete($filename)';
$_[0]->_DELE($_[1]);
}
@@ -881,12 +884,12 @@ sub _store_cmd {
sub port {
- @_ == 1 || @_ == 2 or croak 'usage: $self->port([PORT])';
+ @_ == 1 || @_ == 2 or croak 'usage: $self->port([$port])';
return _eprt('PORT',@_);
}
sub eprt {
- @_ == 1 || @_ == 2 or croak 'usage: $self->eprt([PORT])';
+ @_ == 1 || @_ == 2 or croak 'usage: $self->eprt([$port])';
return _eprt('EPRT',@_);
}
@@ -959,7 +962,7 @@ sub unique_name {
sub supported {
- @_ == 2 or croak 'usage: $ftp->supported( CMD )';
+ @_ == 2 or croak 'usage: $ftp->supported($cmd)';
my $ftp = shift;
my $cmd = uc shift;
my $hash = ${*$ftp}{'net_ftp_supported'} ||= {};
@@ -1282,36 +1285,36 @@ sub pasv_xfer {
sub pasv_wait {
- @_ == 2 or croak 'usage: $ftp->pasv_wait(NON_PASV_FTP)';
+ @_ == 2 or croak 'usage: $ftp->pasv_wait($non_pasv_server)';
- my ($ftp, $non_pasv) = @_;
+ my ($ftp, $non_pasv_server) = @_;
my ($file, $rin, $rout);
vec($rin = '', fileno($ftp), 1) = 1;
select($rout = $rin, undef, undef, undef);
my $dres = $ftp->response();
- my $sres = $non_pasv->response();
+ my $sres = $non_pasv_server->response();
return
unless $dres == CMD_OK && $sres == CMD_OK;
return
- unless $ftp->ok() && $non_pasv->ok();
+ unless $ftp->ok() && $non_pasv_server->ok();
return $1
if $ftp->message =~ /unique file name:\s*(\S*)\s*\)/;
return $1
- if $non_pasv->message =~ /unique file name:\s*(\S*)\s*\)/;
+ if $non_pasv_server->message =~ /unique file name:\s*(\S*)\s*\)/;
return 1;
}
sub feature {
- @_ == 2 or croak 'usage: $ftp->feature( NAME )';
- my ($ftp, $feat) = @_;
+ @_ == 2 or croak 'usage: $ftp->feature($name)';
+ my ($ftp, $name) = @_;
my $feature = ${*$ftp}{net_ftp_feature} ||= do {
my @feat;
@@ -1329,7 +1332,7 @@ sub feature {
\@feat;
};
- return grep { /^\Q$feat\E\b/i } @$feature;
+ return grep { /^\Q$name\E\b/i } @$feature;
}
@@ -1397,25 +1400,6 @@ sub _SYST { shift->unsupported(@_) }
sub _STRU { shift->unsupported(@_) }
sub _REIN { shift->unsupported(@_) }
-{
- # Session Cache with single entry
- # used to make sure that we reuse same session for control and data channels
- package Net::FTP::_SSL_SingleSessionCache;
- sub new { my $x; return bless \$x,shift }
- sub add_session {
- my ($cache,$key,$session) = @_;
- Net::SSLeay::SESSION_free($$cache) if $$cache;
- $$cache = $session;
- }
- sub get_session {
- my $cache = shift;
- return $$cache
- }
- sub DESTROY {
- my $cache = shift;
- Net::SSLeay::SESSION_free($$cache) if $$cache;
- }
-}
1;
@@ -1456,7 +1440,7 @@ and explicit FTPS as defined in RFC4217.
The Net::FTP class is a subclass of Net::Cmd and (depending on avaibility) of
IO::Socket::IP, IO::Socket::INET6 or IO::Socket::INET.
-=head1 OVERVIEW
+=head2 Overview
FTP stands for File Transfer Protocol. It is a way of transferring
files between networked machines. The protocol defines a client
@@ -1487,19 +1471,19 @@ this if you really know what you're doing). This class does not support
the EBCDIC or byte formats, and will default to binary instead if they
are attempted.
-=head1 CONSTRUCTOR
+=head2 Class Methods
=over 4
-=item new ([ HOST ] [, OPTIONS ])
+=item C<new([$host][, %options])>
-This is the constructor for a new Net::FTP object. C<HOST> is the
+This is the constructor for a new Net::FTP object. C<$host> is the
name of the remote host to which an FTP connection is required.
-C<HOST> is optional. If C<HOST> is not given then it may instead be
+C<$host> is optional. If C<$host> is not given then it may instead be
passed as the C<Host> option described below.
-C<OPTIONS> are passed in a hash like fashion, using key and value pairs.
+C<%options> are passed in a hash like fashion, using key and value pairs.
Possible options are:
B<Host> - FTP host to connect to. It may be a single scalar, as defined for
@@ -1570,7 +1554,7 @@ be in $@
=back
-=head1 METHODS
+=head2 Object Methods
Unless otherwise stated all methods return either a I<true> or I<false>
value, with I<true> meaning that the operation was a success. When a method
@@ -1583,7 +1567,7 @@ documented here.
=over 4
-=item login ([LOGIN [,PASSWORD [, ACCOUNT] ] ])
+=item C<login([$login[, $password[, $account]]])>
Log into the remote FTP server with the given login information. If
no arguments are given then the C<Net::FTP> uses the C<Net::Netrc>
@@ -1595,114 +1579,114 @@ will be used for password.
If the connection is via a firewall then the C<authorize> method will
be called with no arguments.
-=item starttls ()
+=item C<starttls()>
Upgrade existing plain connection to SSL.
The SSL arguments have to be given in C<new> already because they are needed for
data connections too.
-=item stoptls ()
+=item C<stoptls()>
Downgrade existing SSL connection back to plain.
This is needed to work with some FTP helpers at firewalls, which need to see the
PORT and PASV commands and responses to dynamically open the necessary ports.
In this case C<starttls> is usually only done to protect the authorization.
-=item prot ( LEVEL )
+=item C<prot($level)>
Set what type of data channel protection the client and server will be using.
-Only C<LEVEL>s "C" (clear) and "P" (private) are supported.
+Only C<$level>s "C" (clear) and "P" (private) are supported.
-=item host ()
+=item C<host()>
Returns the value used by the constructor, and passed to the IO::Socket super
class to connect to the host.
-=item account( ACCT )
+=item C<account($acct)>
Set a string identifying the user's account.
-=item authorize ( [AUTH [, RESP]])
+=item C<authorize([$auth[, $resp]])>
This is a protocol used by some firewall ftp proxies. It is used
to authorise the user to send data out. If both arguments are not specified
then C<authorize> uses C<Net::Netrc> to do a lookup.
-=item site (ARGS)
+=item C<site($args)>
Send a SITE command to the remote server and wait for a response.
Returns most significant digit of the response code.
-=item ascii ()
+=item C<ascii()>
Transfer file in ASCII. CRLF translation will be done if required
-=item binary ()
+=item C<binary()>
Transfer file in binary mode. No transformation will be done.
B<Hint>: If both server and client machines use the same line ending for
text files, then it will be faster to transfer all files in binary mode.
-=item type ( [ TYPE ] )
+=item C<type([$type])>
Set or get if files will be transferred in ASCII or binary mode.
-=item rename ( OLDNAME, NEWNAME )
+=item C<rename($oldname, $newname)>
-Rename a file on the remote FTP server from C<OLDNAME> to C<NEWNAME>. This
+Rename a file on the remote FTP server from C<$oldname> to C<$newname>. This
is done by sending the RNFR and RNTO commands.
-=item delete ( FILENAME )
+=item C<delete($filename)>
-Send a request to the server to delete C<FILENAME>.
+Send a request to the server to delete C<$filename>.
-=item cwd ( [ DIR ] )
+=item C<cwd([$dir])>
Attempt to change directory to the directory given in C<$dir>. If
C<$dir> is C<"..">, the FTP C<CDUP> command is used to attempt to
move up one directory. If no directory is given then an attempt is made
to change the directory to the root directory.
-=item cdup ()
+=item C<cdup()>
Change directory to the parent of the current directory.
-=item passive ( [ PASSIVE ] )
+=item C<passive([$passive])>
Set or get if data connections will be initiated in passive mode.
-=item pwd ()
+=item C<pwd()>
Returns the full pathname of the current directory.
-=item restart ( WHERE )
+=item C<restart($where)>
Set the byte offset at which to begin the next data transfer. Net::FTP simply
records this value and uses it when during the next data transfer. For this
reason this method will not return an error, but setting it may cause
a subsequent data transfer to fail.
-=item rmdir ( DIR [, RECURSE ])
+=item C<rmdir($dir[, $recurse])>
-Remove the directory with the name C<DIR>. If C<RECURSE> is I<true> then
+Remove the directory with the name C<$dir>. If C<$recurse> is I<true> then
C<rmdir> will attempt to delete everything inside the directory.
-=item mkdir ( DIR [, RECURSE ])
+=item C<mkdir($dir[, $recurse])>
-Create a new directory with the name C<DIR>. If C<RECURSE> is I<true> then
+Create a new directory with the name C<$dir>. If C<$recurse> is I<true> then
C<mkdir> will attempt to create all the directories in the given path.
Returns the full pathname to the new directory.
-=item alloc ( SIZE [, RECORD_SIZE] )
+=item C<alloc($size[, $record_size])>
The alloc command allows you to give the ftp server a hint about the size
of the file about to be transferred using the ALLO ftp command. Some storage
systems use this to make intelligent decisions about how to store the file.
-The C<SIZE> argument represents the size of the file in bytes. The
-C<RECORD_SIZE> argument indicates a maximum record or page size for files
+The C<$size> argument represents the size of the file in bytes. The
+C<$record_size> argument indicates a maximum record or page size for files
sent with a record or page structure.
The size of the file will be determined, and sent to the server
@@ -1710,70 +1694,70 @@ automatically for normal files so that this method need only be called if
you are transferring data from a socket, named pipe, or other stream not
associated with a normal file.
-=item ls ( [ DIR ] )
+=item C<ls([$dir])>
-Get a directory listing of C<DIR>, or the current directory.
+Get a directory listing of C<$dir>, or the current directory.
In an array context, returns a list of lines returned from the server. In
a scalar context, returns a reference to a list.
-=item dir ( [ DIR ] )
+=item C<dir([$dir])>
-Get a directory listing of C<DIR>, or the current directory in long format.
+Get a directory listing of C<$dir>, or the current directory in long format.
In an array context, returns a list of lines returned from the server. In
a scalar context, returns a reference to a list.
-=item get ( REMOTE_FILE [, LOCAL_FILE [, WHERE]] )
+=item C<get($remote_file[, $local_file[, $where]])>
-Get C<REMOTE_FILE> from the server and store locally. C<LOCAL_FILE> may be
+Get C<$remote_file> from the server and store locally. C<$local_file> may be
a filename or a filehandle. If not specified, the file will be stored in
the current directory with the same leafname as the remote file.
-If C<WHERE> is given then the first C<WHERE> bytes of the file will
+If C<$where> is given then the first C<$where> bytes of the file will
not be transferred, and the remaining bytes will be appended to
the local file if it already exists.
-Returns C<LOCAL_FILE>, or the generated local file name if C<LOCAL_FILE>
+Returns C<$local_file>, or the generated local file name if C<$local_file>
is not given. If an error was encountered undef is returned.
-=item put ( LOCAL_FILE [, REMOTE_FILE ] )
+=item C<put($local_file[, $remote_file])>
-Put a file on the remote server. C<LOCAL_FILE> may be a name or a filehandle.
-If C<LOCAL_FILE> is a filehandle then C<REMOTE_FILE> must be specified. If
-C<REMOTE_FILE> is not specified then the file will be stored in the current
-directory with the same leafname as C<LOCAL_FILE>.
+Put a file on the remote server. C<$local_file> may be a name or a filehandle.
+If C<$local_file> is a filehandle then C<$remote_file> must be specified. If
+C<$remote_file> is not specified then the file will be stored in the current
+directory with the same leafname as C<$local_file>.
-Returns C<REMOTE_FILE>, or the generated remote filename if C<REMOTE_FILE>
+Returns C<$remote_file>, or the generated remote filename if C<$remote_file>
is not given.
B<NOTE>: If for some reason the transfer does not complete and an error is
returned then the contents that had been transferred will not be remove
automatically.
-=item put_unique ( LOCAL_FILE [, REMOTE_FILE ] )
+=item C<put_unique($local_file[, $remote_file])>
Same as put but uses the C<STOU> command.
Returns the name of the file on the server.
-=item append ( LOCAL_FILE [, REMOTE_FILE ] )
+=item C<append($local_file[, $remote_file])>
Same as put but appends to the file on the remote server.
-Returns C<REMOTE_FILE>, or the generated remote filename if C<REMOTE_FILE>
+Returns C<$remote_file>, or the generated remote filename if C<$remote_file>
is not given.
-=item unique_name ()
+=item C<unique_name()>
Returns the name of the last file stored on the server using the
C<STOU> command.
-=item mdtm ( FILE )
+=item C<mdtm($file)>
Returns the I<modification time> of the given file
-=item size ( FILE )
+=item C<size($file)>
Returns the size in bytes for the given file as stored on the remote server.
@@ -1783,11 +1767,11 @@ and the remote server and local machine have different ideas about
"End Of Line" then the size of file on the local machine after transfer
may be different.
-=item supported ( CMD )
+=item C<supported($cmd)>
Returns TRUE if the remote server supports the given command.
-=item hash ( [FILEHANDLE_GLOB_REF],[ BYTES_PER_HASH_MARK] )
+=item C<hash([$filehandle_glob_ref[, $bytes_per_hash_mark]])>
Called without parameters, or with the first argument false, hash marks
are suppressed. If the first argument is true but not a reference to a
@@ -1796,7 +1780,7 @@ of bytes per hash mark printed, and defaults to 1024. In all cases the
return value is a reference to an array of two: the filehandle glob reference
and the bytes per hash mark.
-=item feature ( NAME )
+=item C<feature($name)>
Determine if the server supports the specified feature. The return
value is a list of lines the server responded with to describe the
@@ -1822,33 +1806,33 @@ reference to a C<Net::FTP::dataconn> based object.
=over 4
-=item nlst ( [ DIR ] )
+=item C<nlst([$dir])>
Send an C<NLST> command to the server, with an optional parameter.
-=item list ( [ DIR ] )
+=item C<list([$dir])>
Same as C<nlst> but using the C<LIST> command
-=item retr ( FILE )
+=item C<retr($file)>
-Begin the retrieval of a file called C<FILE> from the remote server.
+Begin the retrieval of a file called C<$file> from the remote server.
-=item stor ( FILE )
+=item C<stor($file)>
-Tell the server that you wish to store a file. C<FILE> is the
+Tell the server that you wish to store a file. C<$file> is the
name of the new file that should be created.
-=item stou ( FILE )
+=item C<stou($file)>
Same as C<stor> but using the C<STOU> command. The name of the unique
file which was created on the server will be available via the C<unique_name>
method after the data connection has been closed.
-=item appe ( FILE )
+=item C<appe($file)>
Tell the server that we want to append some data to the end of a file
-called C<FILE>. If this file does not exist then create it.
+called C<$file>. If this file does not exist then create it.
=back
@@ -1862,17 +1846,17 @@ C<put_unique> and those that do not require data connections.
=over 4
-=item port ( [ PORT ] )
+=item C<port([$port])>
-=item eprt ( [ PORT ] )
+=item C<eprt([$port])>
-Send a C<PORT> (IPv4) or C<EPRT> (IPv6) command to the server. If C<PORT> is
+Send a C<PORT> (IPv4) or C<EPRT> (IPv6) command to the server. If C<$port> is
specified then it is sent to the server. If not, then a listen socket is created
and the correct information sent to the server.
-=item pasv ()
+=item C<pasv()>
-=item epsv ()
+=item C<epsv()>
Tell the server to go into passive mode (C<pasv> for IPv4, C<epsv> for IPv6).
Returns the text that represents the port on which the server is listening, this
@@ -1886,38 +1870,38 @@ servers, providing that these two servers can connect directly to each other.
=over 4
-=item pasv_xfer ( SRC_FILE, DEST_SERVER [, DEST_FILE ] )
+=item C<pasv_xfer($src_file, $dest_server[, $dest_file ])>
This method will do a file transfer between two remote ftp servers. If
-C<DEST_FILE> is omitted then the leaf name of C<SRC_FILE> will be used.
+C<$dest_file> is omitted then the leaf name of C<$src_file> will be used.
-=item pasv_xfer_unique ( SRC_FILE, DEST_SERVER [, DEST_FILE ] )
+=item C<pasv_xfer_unique($src_file, $dest_server[, $dest_file ])>
Like C<pasv_xfer> but the file is stored on the remote server using
the STOU command.
-=item pasv_wait ( NON_PASV_SERVER )
+=item C<pasv_wait($non_pasv_server)>
This method can be used to wait for a transfer to complete between a passive
server and a non-passive server. The method should be called on the passive
server with the C<Net::FTP> object for the non-passive server passed as an
argument.
-=item abort ()
+=item C<abort()>
Abort the current data transfer.
-=item quit ()
+=item C<quit()>
Send the QUIT command to the remote FTP server and close the socket connection.
=back
-=head2 Methods for the adventurous
+=head2 Methods for the Adventurous
=over 4
-=item quot (CMD [,ARGS])
+=item C<quot($cmd[, $args])>
Send a command, that Net::FTP does not directly support, to the remote
server and wait for a response.
@@ -1927,62 +1911,83 @@ Returns most significant digit of the response code.
B<WARNING> This call should only be used on commands that do not require
data connections. Misuse of this method can hang the connection.
-=item can_inet6 ()
+=item C<can_inet6()>
Returns whether we can use IPv6.
-=item can_ssl ()
+=item C<can_ssl()>
Returns whether we can use SSL.
=back
-=head1 THE dataconn CLASS
+=head2 The dataconn Class
Some of the methods defined in C<Net::FTP> return an object which will
be derived from the C<Net::FTP::dataconn> class. See L<Net::FTP::dataconn> for
more details.
-=head1 UNIMPLEMENTED
+=head2 Unimplemented
The following RFC959 commands have not been implemented:
=over 4
-=item B<SMNT>
+=item C<SMNT>
Mount a different file system structure without changing login or
accounting information.
-=item B<HELP>
+=item C<HELP>
Ask the server for "helpful information" (that's what the RFC says) on
the commands it accepts.
-=item B<MODE>
+=item C<MODE>
Specifies transfer mode (stream, block or compressed) for file to be
transferred.
-=item B<SYST>
+=item C<SYST>
Request remote server system identification.
-=item B<STAT>
+=item C<STAT>
Request remote server status.
-=item B<STRU>
+=item C<STRU>
Specifies file structure for file to be transferred.
-=item B<REIN>
+=item C<REIN>
Reinitialize the connection, flushing all I/O and account information.
=back
-=head1 REPORTING BUGS
+=head1 EXAMPLES
+
+For an example of the use of Net::FTP see
+
+=over 4
+
+=item L<https://www.csh.rit.edu/~adam/Progs/>
+
+C<autoftp> is a program that can retrieve, send, or list files via
+the FTP protocol in a non-interactive manner.
+
+=back
+
+=head1 EXPORTS
+
+I<None>.
+
+=head1 KNOWN BUGS
+
+See L<https://rt.cpan.org/Dist/Display.html?Status=Active&Queue=libnet>.
+
+=head2 Reporting Bugs
When reporting bugs/problems please include as much information as possible.
It may be difficult for me to reproduce the problem as almost every setup
@@ -1994,51 +1999,42 @@ passed to the constructor, and the output sent with the bug report. If you
cannot include a small script then please include a Debug trace from a
run of your program which does yield the problem.
-=head1 AUTHOR
-
-Graham Barr E<lt>F<gbarr@pobox.com>E<gt>.
-
-Steve Hay E<lt>F<shay@cpan.org>E<gt> is now maintaining libnet as of version
-1.22_02.
-
=head1 SEE ALSO
L<Net::Netrc>,
L<Net::Cmd>,
-L<IO::Socket::SSL>
+L<IO::Socket::SSL>;
-ftp(1), ftpd(8), RFC 959, RFC 2428, RFC 4217
-http://www.ietf.org/rfc/rfc959.txt
-http://www.ietf.org/rfc/rfc2428.txt
-http://www.ietf.org/rfc/rfc4217.txt
+L<ftp(1)>,
+L<ftpd(8)>;
-=head1 USE EXAMPLES
+L<https://www.ietf.org/rfc/rfc959.txt>,
+L<https://www.ietf.org/rfc/rfc2428.txt>,
+L<https://www.ietf.org/rfc/rfc4217.txt>.
-For an example of the use of Net::FTP see
+=head1 ACKNOWLEDGEMENTS
-=over 4
+Henry Gabryjelski E<lt>L<henryg@WPI.EDU|mailto:henryg@WPI.EDU>E<gt> - for the
+suggestion of creating directories recursively.
-=item http://www.csh.rit.edu/~adam/Progs/
+Nathan Torkington E<lt>L<gnat@frii.com|mailto:gnat@frii.com>E<gt> - for some
+input on the documentation.
-C<autoftp> is a program that can retrieve, send, or list files via
-the FTP protocol in a non-interactive manner.
+Roderick Schertler E<lt>L<roderick@gate.net|mailto:roderick@gate.net>E<gt> - for
+various inputs
-=back
-
-=head1 CREDITS
-
-Henry Gabryjelski <henryg@WPI.EDU> - for the suggestion of creating directories
-recursively.
+=head1 AUTHOR
-Nathan Torkington <gnat@frii.com> - for some input on the documentation.
+Graham Barr E<lt>L<gbarr@pobox.com|mailto:gbarr@pobox.com>E<gt>.
-Roderick Schertler <roderick@gate.net> - for various inputs
+Steve Hay E<lt>L<shay@cpan.org|mailto:shay@cpan.org>E<gt> is now maintaining
+libnet as of version 1.22_02.
=head1 COPYRIGHT
Copyright (C) 1995-2004 Graham Barr. All rights reserved.
-Copyright (C) 2013-2017 Steve Hay. All rights reserved.
+Copyright (C) 2013-2017, 2020 Steve Hay. All rights reserved.
=head1 LICENCE
@@ -2046,4 +2042,16 @@ This module is free software; you can redistribute it and/or modify it under the
same terms as Perl itself, i.e. under the terms of either the GNU General Public
License or the Artistic License, as specified in the F<LICENCE> file.
+=head1 VERSION
+
+Version 3.12
+
+=head1 DATE
+
+09 Dec 2020
+
+=head1 HISTORY
+
+See the F<Changes> file.
+
=cut
diff --git a/cpan/libnet/lib/Net/FTP/A.pm b/cpan/libnet/lib/Net/FTP/A.pm
index 0ea1ba2fbd..f22c974ba9 100644
--- a/cpan/libnet/lib/Net/FTP/A.pm
+++ b/cpan/libnet/lib/Net/FTP/A.pm
@@ -13,7 +13,7 @@ use Carp;
use Net::FTP::dataconn;
our @ISA = qw(Net::FTP::dataconn);
-our $VERSION = "3.11";
+our $VERSION = "3.12";
our $buf;
diff --git a/cpan/libnet/lib/Net/FTP/E.pm b/cpan/libnet/lib/Net/FTP/E.pm
index 30b371a58b..df281c05b9 100644
--- a/cpan/libnet/lib/Net/FTP/E.pm
+++ b/cpan/libnet/lib/Net/FTP/E.pm
@@ -8,6 +8,6 @@ use warnings;
use Net::FTP::I;
our @ISA = qw(Net::FTP::I);
-our $VERSION = "3.11";
+our $VERSION = "3.12";
1;
diff --git a/cpan/libnet/lib/Net/FTP/I.pm b/cpan/libnet/lib/Net/FTP/I.pm
index ec46ab0fda..8f85e0e1cf 100644
--- a/cpan/libnet/lib/Net/FTP/I.pm
+++ b/cpan/libnet/lib/Net/FTP/I.pm
@@ -13,7 +13,7 @@ use Carp;
use Net::FTP::dataconn;
our @ISA = qw(Net::FTP::dataconn);
-our $VERSION = "3.11";
+our $VERSION = "3.12";
our $buf;
diff --git a/cpan/libnet/lib/Net/FTP/L.pm b/cpan/libnet/lib/Net/FTP/L.pm
index d9a88576d9..9eda6107d1 100644
--- a/cpan/libnet/lib/Net/FTP/L.pm
+++ b/cpan/libnet/lib/Net/FTP/L.pm
@@ -8,6 +8,6 @@ use warnings;
use Net::FTP::I;
our @ISA = qw(Net::FTP::I);
-our $VERSION = "3.11";
+our $VERSION = "3.12";
1;
diff --git a/cpan/libnet/lib/Net/FTP/dataconn.pm b/cpan/libnet/lib/Net/FTP/dataconn.pm
index 337b0e999b..51e9c2f2d2 100644
--- a/cpan/libnet/lib/Net/FTP/dataconn.pm
+++ b/cpan/libnet/lib/Net/FTP/dataconn.pm
@@ -13,7 +13,7 @@ use Carp;
use Errno;
use Net::Cmd;
-our $VERSION = '3.11';
+our $VERSION = '3.12';
$Net::FTP::IOCLASS or die "please load Net::FTP before Net::FTP::dataconn";
our @ISA = $Net::FTP::IOCLASS;
@@ -137,6 +137,22 @@ __END__
Net::FTP::dataconn - FTP Client data connection class
+=head1 SYNOPSIS
+
+ # Perform IO operations on an FTP client data connection object:
+
+ $num_bytes_read = $obj->read($buffer, $size);
+ $num_bytes_read = $obj->read($buffer, $size, $timeout);
+
+ $num_bytes_written = $obj->write($buffer, $size);
+ $num_bytes_written = $obj->write($buffer, $size, $timeout);
+
+ $num_bytes_read_so_far = $obj->bytes_read();
+
+ $obj->abort();
+
+ $closed_successfully = $obj->close();
+
=head1 DESCRIPTION
Some of the methods defined in C<Net::FTP> return an object which will
@@ -147,31 +163,31 @@ be performed using these.
=over 4
-=item read ( BUFFER, SIZE [, TIMEOUT ] )
+=item C<read($buffer, $size[, $timeout])>
-Read C<SIZE> bytes of data from the server and place it into C<BUFFER>, also
-performing any <CRLF> translation necessary. C<TIMEOUT> is optional, if not
+Read C<$size> bytes of data from the server and place it into C<$buffer>, also
+performing any <CRLF> translation necessary. C<$timeout> is optional, if not
given, the timeout value from the command connection will be used.
Returns the number of bytes read before any <CRLF> translation.
-=item write ( BUFFER, SIZE [, TIMEOUT ] )
+=item C<write($buffer, $size[, $timeout])>
-Write C<SIZE> bytes of data from C<BUFFER> to the server, also
-performing any <CRLF> translation necessary. C<TIMEOUT> is optional, if not
+Write C<$size> bytes of data from C<$buffer> to the server, also
+performing any <CRLF> translation necessary. C<$timeout> is optional, if not
given, the timeout value from the command connection will be used.
Returns the number of bytes written before any <CRLF> translation.
-=item bytes_read ()
+=item C<bytes_read()>
Returns the number of bytes read so far.
-=item abort ()
+=item C<abort()>
Abort the current data transfer.
-=item close ()
+=item C<close()>
Close the data connection and get a response from the FTP server. Returns
I<true> if the connection was closed successfully and the first digit of
@@ -179,4 +195,43 @@ the response from the server was a '2'.
=back
+=head1 EXPORTS
+
+I<None>.
+
+=head1 KNOWN BUGS
+
+I<None>.
+
+=head1 AUTHOR
+
+Graham Barr E<lt>L<gbarr@pobox.com|mailto:gbarr@pobox.com>E<gt>.
+
+Steve Hay E<lt>L<shay@cpan.org|mailto:shay@cpan.org>E<gt> is now maintaining
+libnet as of version 1.22_02.
+
+=head1 COPYRIGHT
+
+Copyright (C) 1997-2010 Graham Barr. All rights reserved.
+
+Copyright (C) 2013-2014, 2020 Steve Hay. All rights reserved.
+
+=head1 LICENCE
+
+This module is free software; you can redistribute it and/or modify it under the
+same terms as Perl itself, i.e. under the terms of either the GNU General Public
+License or the Artistic License, as specified in the F<LICENCE> file.
+
+=head1 VERSION
+
+Version 3.12
+
+=head1 DATE
+
+09 Dec 2020
+
+=head1 HISTORY
+
+See the F<Changes> file.
+
=cut
diff --git a/cpan/libnet/lib/Net/NNTP.pm b/cpan/libnet/lib/Net/NNTP.pm
index 0c22930148..9289b59432 100644
--- a/cpan/libnet/lib/Net/NNTP.pm
+++ b/cpan/libnet/lib/Net/NNTP.pm
@@ -1,7 +1,7 @@
# Net::NNTP.pm
#
# Copyright (C) 1995-1997 Graham Barr. All rights reserved.
-# Copyright (C) 2013-2016 Steve Hay. All rights reserved.
+# Copyright (C) 2013-2016, 2020 Steve Hay. All rights reserved.
# This module is free software; you can redistribute it and/or modify it under
# the same terms as Perl itself, i.e. under the terms of either the GNU General
# Public License or the Artistic License, as specified in the F<LICENCE> file.
@@ -19,7 +19,7 @@ use Net::Cmd;
use Net::Config;
use Time::Local;
-our $VERSION = "3.11";
+our $VERSION = "3.12";
# Code for detecting if we can use SSL
my $ssl_class = eval {
@@ -96,7 +96,6 @@ sub new {
if ($arg{SSL}) {
Net::NNTP::_SSL->start_SSL($obj,%arg) or next;
}
- last:
}
return
@@ -176,7 +175,7 @@ sub starttls {
sub article {
- @_ >= 1 && @_ <= 3 or croak 'usage: $nntp->article( [ MSGID ], [ FH ] )';
+ @_ >= 1 && @_ <= 3 or croak 'usage: $nntp->article([{$msgid|$msgnum}[, $fh]])';
my $nntp = shift;
my @fh;
@@ -189,7 +188,7 @@ sub article {
sub articlefh {
- @_ >= 1 && @_ <= 2 or croak 'usage: $nntp->articlefh( [ MSGID ] )';
+ @_ >= 1 && @_ <= 2 or croak 'usage: $nntp->articlefh([{$msgid|$msgnum}])';
my $nntp = shift;
return unless $nntp->_ARTICLE(@_);
@@ -198,7 +197,7 @@ sub articlefh {
sub authinfo {
- @_ == 3 or croak 'usage: $nntp->authinfo( USER, PASS )';
+ @_ == 3 or croak 'usage: $nntp->authinfo($user, $pass)';
my ($nntp, $user, $pass) = @_;
$nntp->_AUTHINFO("USER", $user) == CMD_MORE
@@ -207,7 +206,7 @@ sub authinfo {
sub authinfo_simple {
- @_ == 3 or croak 'usage: $nntp->authinfo( USER, PASS )';
+ @_ == 3 or croak 'usage: $nntp->authinfo_simple($user, $pass)';
my ($nntp, $user, $pass) = @_;
$nntp->_AUTHINFO('SIMPLE') == CMD_MORE
@@ -216,7 +215,7 @@ sub authinfo_simple {
sub body {
- @_ >= 1 && @_ <= 3 or croak 'usage: $nntp->body( [ MSGID ], [ FH ] )';
+ @_ >= 1 && @_ <= 3 or croak 'usage: $nntp->body([{$msgid|$msgnum}[, $fh]])';
my $nntp = shift;
my @fh;
@@ -229,7 +228,7 @@ sub body {
sub bodyfh {
- @_ >= 1 && @_ <= 2 or croak 'usage: $nntp->bodyfh( [ MSGID ] )';
+ @_ >= 1 && @_ <= 2 or croak 'usage: $nntp->bodyfh([{$msgid|$msgnum}])';
my $nntp = shift;
return unless $nntp->_BODY(@_);
return $nntp->tied_fh;
@@ -237,7 +236,7 @@ sub bodyfh {
sub head {
- @_ >= 1 && @_ <= 3 or croak 'usage: $nntp->head( [ MSGID ], [ FH ] )';
+ @_ >= 1 && @_ <= 3 or croak 'usage: $nntp->head([{$msgid|$msgnum}[, $fh]])';
my $nntp = shift;
my @fh;
@@ -250,7 +249,7 @@ sub head {
sub headfh {
- @_ >= 1 && @_ <= 2 or croak 'usage: $nntp->headfh( [ MSGID ] )';
+ @_ >= 1 && @_ <= 2 or croak 'usage: $nntp->headfh([{$msgid|$msgnum}])';
my $nntp = shift;
return unless $nntp->_HEAD(@_);
return $nntp->tied_fh;
@@ -258,7 +257,7 @@ sub headfh {
sub nntpstat {
- @_ == 1 || @_ == 2 or croak 'usage: $nntp->nntpstat( [ MSGID ] )';
+ @_ == 1 || @_ == 2 or croak 'usage: $nntp->nntpstat([{$msgid|$msgnum}])';
my $nntp = shift;
$nntp->_STAT(@_) && $nntp->message =~ /(<[^>]+>)/o
@@ -268,7 +267,7 @@ sub nntpstat {
sub group {
- @_ == 1 || @_ == 2 or croak 'usage: $nntp->group( [ GROUP ] )';
+ @_ == 1 || @_ == 2 or croak 'usage: $nntp->group([$group])';
my $nntp = shift;
my $grp = ${*$nntp}{'net_nntp_group'};
@@ -308,11 +307,11 @@ sub help {
sub ihave {
- @_ >= 2 or croak 'usage: $nntp->ihave( MESSAGE-ID [, MESSAGE ])';
- my $nntp = shift;
- my $mid = shift;
+ @_ >= 2 or croak 'usage: $nntp->ihave($msgid[, $message])';
+ my $nntp = shift;
+ my $msgid = shift;
- $nntp->_IHAVE($mid) && $nntp->datasend(@_)
+ $nntp->_IHAVE($msgid) && $nntp->datasend(@_)
? @_ == 0 || $nntp->dataend
: undef;
}
@@ -339,15 +338,15 @@ sub list {
sub newgroups {
- @_ >= 2 or croak 'usage: $nntp->newgroups( SINCE [, DISTRIBUTIONS ])';
+ @_ >= 2 or croak 'usage: $nntp->newgroups($since[, $distributions])';
my $nntp = shift;
- my $time = _timestr(shift);
- my $dist = shift || "";
+ my $since = _timestr(shift);
+ my $distributions = shift || "";
- $dist = join(",", @{$dist})
- if ref($dist);
+ $distributions = join(",", @{$distributions})
+ if ref($distributions);
- $nntp->_NEWGROUPS($time, $dist)
+ $nntp->_NEWGROUPS($since, $distributions)
? $nntp->_grouplist
: undef;
}
@@ -355,20 +354,20 @@ sub newgroups {
sub newnews {
@_ >= 2 && @_ <= 4
- or croak 'usage: $nntp->newnews( SINCE [, GROUPS [, DISTRIBUTIONS ]])';
+ or croak 'usage: $nntp->newnews($since[, $groups[, $distributions]])';
my $nntp = shift;
- my $time = _timestr(shift);
- my $grp = @_ ? shift: $nntp->group;
- my $dist = shift || "";
+ my $since = _timestr(shift);
+ my $groups = @_ ? shift : $nntp->group;
+ my $distributions = shift || "";
- $grp ||= "*";
- $grp = join(",", @{$grp})
- if ref($grp);
+ $groups ||= "*";
+ $groups = join(",", @{$groups})
+ if ref($groups);
- $dist = join(",", @{$dist})
- if ref($dist);
+ $distributions = join(",", @{$distributions})
+ if ref($distributions);
- $nntp->_NEWNEWS($grp, $time, $dist)
+ $nntp->_NEWNEWS($groups, $since, $distributions)
? $nntp->_articlelist
: undef;
}
@@ -385,7 +384,7 @@ sub next {
sub post {
- @_ >= 1 or croak 'usage: $nntp->post( [ MESSAGE ] )';
+ @_ >= 1 or croak 'usage: $nntp->post([$message])';
my $nntp = shift;
$nntp->_POST() && $nntp->datasend(@_)
@@ -423,7 +422,7 @@ sub slave {
sub active {
- @_ == 1 || @_ == 2 or croak 'usage: $nntp->active( [ PATTERN ] )';
+ @_ == 1 || @_ == 2 or croak 'usage: $nntp->active([$pattern])';
my $nntp = shift;
$nntp->_LIST('ACTIVE', @_)
@@ -453,7 +452,7 @@ sub distributions {
sub distribution_patterns {
- @_ == 1 or croak 'usage: $nntp->distributions()';
+ @_ == 1 or croak 'usage: $nntp->distribution_patterns()';
my $nntp = shift;
my $arr;
@@ -468,7 +467,7 @@ sub distribution_patterns {
sub newsgroups {
- @_ == 1 || @_ == 2 or croak 'usage: $nntp->newsgroups( [ PATTERN ] )';
+ @_ == 1 || @_ == 2 or croak 'usage: $nntp->newsgroups([$pattern])';
my $nntp = shift;
$nntp->_LIST('NEWSGROUPS', @_)
@@ -498,7 +497,7 @@ sub subscriptions {
sub listgroup {
- @_ == 1 || @_ == 2 or croak 'usage: $nntp->listgroup( [ GROUP ] )';
+ @_ == 1 || @_ == 2 or croak 'usage: $nntp->listgroup([$group])';
my $nntp = shift;
$nntp->_LISTGROUP(@_)
@@ -516,7 +515,7 @@ sub reader {
sub xgtitle {
- @_ == 1 || @_ == 2 or croak 'usage: $nntp->xgtitle( [ PATTERN ] )';
+ @_ == 1 || @_ == 2 or croak 'usage: $nntp->xgtitle([$pattern])';
my $nntp = shift;
$nntp->_XGTITLE(@_)
@@ -526,19 +525,19 @@ sub xgtitle {
sub xhdr {
- @_ >= 2 && @_ <= 4 or croak 'usage: $nntp->xhdr( HEADER, [ MESSAGE-SPEC ] )';
+ @_ >= 2 && @_ <= 4 or croak 'usage: $nntp->xhdr($header[, $message_spec])';
my $nntp = shift;
- my $hdr = shift;
- my $arg = _msg_arg(@_);
+ my $header = shift;
+ my $arg = _msg_arg(@_);
- $nntp->_XHDR($hdr, $arg)
+ $nntp->_XHDR($header, $arg)
? $nntp->_description
: undef;
}
sub xover {
- @_ == 2 || @_ == 3 or croak 'usage: $nntp->xover( MESSAGE-SPEC )';
+ @_ == 2 || @_ == 3 or croak 'usage: $nntp->xover($message_spec)';
my $nntp = shift;
my $arg = _msg_arg(@_);
@@ -549,27 +548,27 @@ sub xover {
sub xpat {
- @_ == 4 || @_ == 5 or croak '$nntp->xpat( HEADER, PATTERN, MESSAGE-SPEC )';
+ @_ == 4 || @_ == 5 or croak 'usage: $nntp->xpat($header, $pattern, $message_spec )';
my $nntp = shift;
- my $hdr = shift;
- my $pat = shift;
- my $arg = _msg_arg(@_);
+ my $header = shift;
+ my $pattern = shift;
+ my $arg = _msg_arg(@_);
- $pat = join(" ", @$pat)
- if ref($pat);
+ $pattern = join(" ", @$pattern)
+ if ref($pattern);
- $nntp->_XPAT($hdr, $arg, $pat)
+ $nntp->_XPAT($header, $arg, $pattern)
? $nntp->_description
: undef;
}
sub xpath {
- @_ == 2 or croak 'usage: $nntp->xpath( MESSAGE-ID )';
- my ($nntp, $mid) = @_;
+ @_ == 2 or croak 'usage: $nntp->xpath($message_id)';
+ my ($nntp, $message_id) = @_;
return
- unless $nntp->_XPATH($mid);
+ unless $nntp->_XPATH($message_id);
my $m;
($m = $nntp->message) =~ s/^\d+\s+//o;
@@ -580,7 +579,7 @@ sub xpath {
sub xrover {
- @_ == 2 || @_ == 3 or croak 'usage: $nntp->xrover( MESSAGE-SPEC )';
+ @_ == 2 || @_ == 3 or croak 'usage: $nntp->xrover($message_spec)';
my $nntp = shift;
my $arg = _msg_arg(@_);
@@ -596,7 +595,7 @@ sub date {
$nntp->_DATE
&& $nntp->message =~ /(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)/
- ? timegm($6, $5, $4, $3, $2 - 1, $1 - 1900)
+ ? timegm($6, $5, $4, $3, $2 - 1, $1)
: undef;
}
@@ -807,20 +806,20 @@ explicit TLS encryption, i.e. NNTPS or NNTP+STARTTLS.
The Net::NNTP class is a subclass of Net::Cmd and (depending on avaibility) of
IO::Socket::IP, IO::Socket::INET6 or IO::Socket::INET.
-=head1 CONSTRUCTOR
+=head2 Class Methods
=over 4
-=item new ( [ HOST ] [, OPTIONS ])
+=item C<new([$host][, %options])>
-This is the constructor for a new Net::NNTP object. C<HOST> is the
+This is the constructor for a new Net::NNTP object. C<$host> is the
name of the remote host to which a NNTP connection is required. If not
given then it may be passed as the C<Host> option described below. If no host is passed
then two environment variables are checked, first C<NNTPSERVER> then
C<NEWSHOST>, then C<Net::Config> is checked, and if a host is not found
then C<news> is used.
-C<OPTIONS> are passed in a hash like fashion, using key and value pairs.
+C<%options> are passed in a hash like fashion, using key and value pairs.
Possible options are:
B<Host> - NNTP host to connect to. It may be a single scalar, as defined for
@@ -857,7 +856,7 @@ class. Alternatively B<Family> can be used.
=back
-=head1 METHODS
+=head2 Object Methods
Unless otherwise stated all methods return either a I<true> or I<false>
value, with I<true> meaning that the operation was a success. When a method
@@ -870,58 +869,58 @@ documented here.
=over 4
-=item host ()
+=item C<host()>
Returns the value used by the constructor, and passed to IO::Socket::INET,
to connect to the host.
-=item starttls ()
+=item C<starttls()>
Upgrade existing plain connection to SSL.
Any arguments necessary for SSL must be given in C<new> already.
-=item article ( [ MSGID|MSGNUM ], [FH] )
+=item C<article([{$msgid|$msgnum}[, $fh]])>
Retrieve the header, a blank line, then the body (text) of the
specified article.
-If C<FH> is specified then it is expected to be a valid filehandle
+If C<$fh> is specified then it is expected to be a valid filehandle
and the result will be printed to it, on success a true value will be
-returned. If C<FH> is not specified then the return value, on success,
+returned. If C<$fh> is not specified then the return value, on success,
will be a reference to an array containing the article requested, each
entry in the array will contain one line of the article.
If no arguments are passed then the current article in the currently
selected newsgroup is fetched.
-C<MSGNUM> is a numeric id of an article in the current newsgroup, and
-will change the current article pointer. C<MSGID> is the message id of
+C<$msgnum> is a numeric id of an article in the current newsgroup, and
+will change the current article pointer. C<$msgid> is the message id of
an article as shown in that article's header. It is anticipated that the
-client will obtain the C<MSGID> from a list provided by the C<newnews>
+client will obtain the C<$msgid> from a list provided by the C<newnews>
command, from references contained within another article, or from the
message-id provided in the response to some other commands.
If there is an error then C<undef> will be returned.
-=item body ( [ MSGID|MSGNUM ], [FH] )
+=item C<body([{$msgid|$msgnum}[, [$fh]])>
Like C<article> but only fetches the body of the article.
-=item head ( [ MSGID|MSGNUM ], [FH] )
+=item C<head([{$msgid|$msgnum}[, [$fh]])>
Like C<article> but only fetches the headers for the article.
-=item articlefh ( [ MSGID|MSGNUM ] )
+=item C<articlefh([{$msgid|$msgnum}])>
-=item bodyfh ( [ MSGID|MSGNUM ] )
+=item C<bodyfh([{$msgid|$msgnum}])>
-=item headfh ( [ MSGID|MSGNUM ] )
+=item C<headfh([{$msgid|$msgnum}])>
These are similar to article(), body() and head(), but rather than
returning the requested data directly, they return a tied filehandle
from which to read the article.
-=item nntpstat ( [ MSGID|MSGNUM ] )
+=item C<nntpstat([{$msgid|$msgnum}])>
The C<nntpstat> command is similar to the C<article> command except that no
text is returned. When selecting by message number within a group,
@@ -934,9 +933,9 @@ selection by message-id does B<not> alter the "current article pointer".
Returns the message-id of the "current article".
-=item group ( [ GROUP ] )
+=item C<group([$group])>
-Set and/or get the current group. If C<GROUP> is not given then information
+Set and/or get the current group. If C<$group> is not given then information
is returned on the current group.
In a scalar context it returns the group name.
@@ -945,45 +944,45 @@ In an array context the return value is a list containing, the number
of articles in the group, the number of the first article, the number
of the last article and the group name.
-=item help ( )
+=item C<help()>
Request help text (a short summary of commands that are understood by this
implementation) from the server. Returns the text or undef upon failure.
-=item ihave ( MSGID [, MESSAGE ])
+=item C<ihave($msgid[, $message])>
The C<ihave> command informs the server that the client has an article
-whose id is C<MSGID>. If the server desires a copy of that
-article and C<MESSAGE> has been given then it will be sent.
+whose id is C<$msgid>. If the server desires a copy of that
+article and C<$message> has been given then it will be sent.
-Returns I<true> if the server desires the article and C<MESSAGE> was
+Returns I<true> if the server desires the article and C<$message> was
successfully sent, if specified.
-If C<MESSAGE> is not specified then the message must be sent using the
+If C<$message> is not specified then the message must be sent using the
C<datasend> and C<dataend> methods from L<Net::Cmd>
-C<MESSAGE> can be either an array of lines or a reference to an array
+C<$message> can be either an array of lines or a reference to an array
and must be encoded by the caller to octets of whatever encoding is required,
e.g. by using the Encode module's C<encode()> function.
-=item last ()
+=item C<last()>
Set the "current article pointer" to the previous article in the current
newsgroup.
Returns the message-id of the article.
-=item date ()
+=item C<date()>
Returns the date on the remote server. This date will be in a UNIX time
format (seconds since 1970)
-=item postok ()
+=item C<postok()>
C<postok> will return I<true> if the servers initial response indicated
that it will allow posting.
-=item authinfo ( USER, PASS )
+=item C<authinfo($user, $pass)>
Authenticates to the server (using the original AUTHINFO USER / AUTHINFO PASS
form, defined in RFC2980) using the supplied username and password. Please
@@ -991,61 +990,61 @@ note that the password is sent in clear text to the server. This command
should not be used with valuable passwords unless the connection to the server
is somehow protected.
-=item authinfo_simple ( USER, PASS )
+=item C<authinfo_simple($user, $pass)>
Authenticates to the server (using the proposed NNTP V2 AUTHINFO SIMPLE form,
defined and deprecated in RFC2980) using the supplied username and password.
As with L</authinfo> the password is sent in clear text.
-=item list ()
+=item C<list()>
Obtain information about all the active newsgroups. The results is a reference
to a hash where the key is a group name and each value is a reference to an
array. The elements in this array are:- the last article number in the group,
the first article number in the group and any information flags about the group.
-=item newgroups ( SINCE [, DISTRIBUTIONS ])
+=item C<newgroups($since[, $distributions])>
-C<SINCE> is a time value and C<DISTRIBUTIONS> is either a distribution
+C<$since> is a time value and C<$distributions> is either a distribution
pattern or a reference to a list of distribution patterns.
The result is the same as C<list>, but the
-groups return will be limited to those created after C<SINCE> and, if
-specified, in one of the distribution areas in C<DISTRIBUTIONS>.
+groups return will be limited to those created after C<$since> and, if
+specified, in one of the distribution areas in C<$distributions>.
-=item newnews ( SINCE [, GROUPS [, DISTRIBUTIONS ]])
+=item C<newnews($since[, $groups[, $distributions]])>
-C<SINCE> is a time value. C<GROUPS> is either a group pattern or a reference
-to a list of group patterns. C<DISTRIBUTIONS> is either a distribution
+C<$since> is a time value. C<$groups> is either a group pattern or a reference
+to a list of group patterns. C<$distributions> is either a distribution
pattern or a reference to a list of distribution patterns.
Returns a reference to a list which contains the message-ids of all news posted
-after C<SINCE>, that are in a groups which matched C<GROUPS> and a
-distribution which matches C<DISTRIBUTIONS>.
+after C<$since>, that are in a groups which matched C<$groups> and a
+distribution which matches C<$distributions>.
-=item next ()
+=item C<next()>
Set the "current article pointer" to the next article in the current
newsgroup.
Returns the message-id of the article.
-=item post ( [ MESSAGE ] )
+=item C<post([$message])>
-Post a new article to the news server. If C<MESSAGE> is specified and posting
+Post a new article to the news server. If C<$message> is specified and posting
is allowed then the message will be sent.
-If C<MESSAGE> is not specified then the message must be sent using the
+If C<$message> is not specified then the message must be sent using the
C<datasend> and C<dataend> methods from L<Net::Cmd>
-C<MESSAGE> can be either an array of lines or a reference to an array
+C<$message> can be either an array of lines or a reference to an array
and must be encoded by the caller to octets of whatever encoding is required,
e.g. by using the Encode module's C<encode()> function.
-The message, either sent via C<datasend> or as the C<MESSAGE>
+The message, either sent via C<datasend> or as the C<$message>
parameter, must be in the format as described by RFC822 and must
contain From:, Newsgroups: and Subject: headers.
-=item postfh ()
+=item C<postfh()>
Post a new article to the news server using a tied filehandle. If
posting is allowed, this method will return a tied filehandle that you
@@ -1054,85 +1053,85 @@ explicitly close() the filehandle when you are finished posting the
article, and the return value from the close() call will indicate
whether the message was successfully posted.
-=item slave ()
+=item C<slave()>
Tell the remote server that I am not a user client, but probably another
news server.
-=item quit ()
+=item C<quit()>
Quit the remote server and close the socket connection.
-=item can_inet6 ()
+=item C<can_inet6()>
Returns whether we can use IPv6.
-=item can_ssl ()
+=item C<can_ssl()>
Returns whether we can use SSL.
=back
-=head2 Extension methods
+=head2 Extension Methods
These methods use commands that are not part of the RFC977 documentation. Some
servers may not support all of them.
=over 4
-=item newsgroups ( [ PATTERN ] )
+=item C<newsgroups([$pattern])>
Returns a reference to a hash where the keys are all the group names which
-match C<PATTERN>, or all of the groups if no pattern is specified, and
+match C<$pattern>, or all of the groups if no pattern is specified, and
each value contains the description text for the group.
-=item distributions ()
+=item C<distributions()>
Returns a reference to a hash where the keys are all the possible
distribution names and the values are the distribution descriptions.
-=item distribution_patterns ()
+=item C<distribution_patterns()>
Returns a reference to an array where each element, itself an array
reference, consists of the three fields of a line of the distrib.pats list
maintained by some NNTP servers, namely: a weight, a wildmat and a value
which the client may use to construct a Distribution header.
-=item subscriptions ()
+=item C<subscriptions()>
Returns a reference to a list which contains a list of groups which
are recommended for a new user to subscribe to.
-=item overview_fmt ()
+=item C<overview_fmt()>
Returns a reference to an array which contain the names of the fields returned
by C<xover>.
-=item active_times ()
+=item C<active_times()>
Returns a reference to a hash where the keys are the group names and each
value is a reference to an array containing the time the groups was created
and an identifier, possibly an Email address, of the creator.
-=item active ( [ PATTERN ] )
+=item C<active([$pattern])>
Similar to C<list> but only active groups that match the pattern are returned.
-C<PATTERN> can be a group pattern.
+C<$pattern> can be a group pattern.
-=item xgtitle ( PATTERN )
+=item C<xgtitle($pattern)>
Returns a reference to a hash where the keys are all the group names which
-match C<PATTERN> and each value is the description text for the group.
+match C<$pattern> and each value is the description text for the group.
-=item xhdr ( HEADER, MESSAGE-SPEC )
+=item C<xhdr($header, $message_spec)>
-Obtain the header field C<HEADER> for all the messages specified.
+Obtain the header field C<$header> for all the messages specified.
The return value will be a reference
to a hash where the keys are the message numbers and each value contains
the text of the requested header for that message.
-=item xover ( MESSAGE-SPEC )
+=item C<xover($message_spec)>
The return value will be a reference
to a hash where the keys are the message numbers and each value contains
@@ -1141,17 +1140,17 @@ message.
The names of the fields can be obtained by calling C<overview_fmt>.
-=item xpath ( MESSAGE-ID )
+=item C<xpath($message_id)>
Returns the path name to the file on the server which contains the specified
message.
-=item xpat ( HEADER, PATTERN, MESSAGE-SPEC)
+=item C<xpat($header, $pattern, $message_spec)>
The result is the same as C<xhdr> except the is will be restricted to
-headers where the text of the header matches C<PATTERN>
+headers where the text of the header matches C<$pattern>
-=item xrover ()
+=item C<xrover($message_spec)>
The XROVER command returns reference information for the article(s)
specified.
@@ -1159,12 +1158,12 @@ specified.
Returns a reference to a HASH where the keys are the message numbers and the
values are the References: lines from the articles
-=item listgroup ( [ GROUP ] )
+=item C<listgroup([$group])>
-Returns a reference to a list of all the active messages in C<GROUP>, or
-the current group if C<GROUP> is not specified.
+Returns a reference to a list of all the active messages in C<$group>, or
+the current group if C<$group> is not specified.
-=item reader ()
+=item C<reader()>
Tell the server that you are a reader and not another server.
@@ -1179,7 +1178,7 @@ the response is harmless.
=back
-=head1 UNSUPPORTED
+=head2 Unsupported
The following NNTP command are unsupported by the package, and there are
no plans to do so.
@@ -1189,16 +1188,16 @@ no plans to do so.
XSEARCH
XINDEX
-=head1 DEFINITIONS
+=head2 Definitions
=over 4
-=item MESSAGE-SPEC
+=item $message_spec
-C<MESSAGE-SPEC> is either a single message-id, a single message number, or
+C<$message_spec> is either a single message-id, a single message number, or
a reference to a list of two message numbers.
-If C<MESSAGE-SPEC> is a reference to a list of two message numbers and the
+If C<$message_spec> is a reference to a list of two message numbers and the
second number in a range is less than or equal to the first then the range
represents all messages in the group after the first message number.
@@ -1206,7 +1205,7 @@ B<NOTE> For compatibility reasons only with earlier versions of Net::NNTP
a message spec can be passed as a list of two numbers, this is deprecated
and a reference to the list should now be passed
-=item PATTERN
+=item $pattern
The C<NNTP> protocol uses the C<WILDMAT> format for patterns.
The WILDMAT format was first developed by Rich Salz based on
@@ -1275,23 +1274,31 @@ with a and ends with d.
=back
+=head1 EXPORTS
+
+I<None>.
+
+=head1 KNOWN BUGS
+
+See L<https://rt.cpan.org/Dist/Display.html?Status=Active&Queue=libnet>.
+
=head1 SEE ALSO
L<Net::Cmd>,
-L<IO::Socket::SSL>
+L<IO::Socket::SSL>.
=head1 AUTHOR
-Graham Barr E<lt>F<gbarr@pobox.com>E<gt>.
+Graham Barr E<lt>L<gbarr@pobox.com|mailto:gbarr@pobox.com>E<gt>.
-Steve Hay E<lt>F<shay@cpan.org>E<gt> is now maintaining libnet as of version
-1.22_02.
+Steve Hay E<lt>L<shay@cpan.org|mailto:shay@cpan.org>E<gt> is now maintaining
+libnet as of version 1.22_02.
=head1 COPYRIGHT
Copyright (C) 1995-1997 Graham Barr. All rights reserved.
-Copyright (C) 2013-2016 Steve Hay. All rights reserved.
+Copyright (C) 2013-2016, 2020 Steve Hay. All rights reserved.
=head1 LICENCE
@@ -1299,4 +1306,16 @@ This module is free software; you can redistribute it and/or modify it under the
same terms as Perl itself, i.e. under the terms of either the GNU General Public
License or the Artistic License, as specified in the F<LICENCE> file.
+=head1 VERSION
+
+Version 3.12
+
+=head1 DATE
+
+09 Dec 2020
+
+=head1 HISTORY
+
+See the F<Changes> file.
+
=cut
diff --git a/cpan/libnet/lib/Net/Netrc.pm b/cpan/libnet/lib/Net/Netrc.pm
index 46fba2787c..b66eb82d8b 100644
--- a/cpan/libnet/lib/Net/Netrc.pm
+++ b/cpan/libnet/lib/Net/Netrc.pm
@@ -1,7 +1,7 @@
# Net::Netrc.pm
#
# Copyright (C) 1995-1998 Graham Barr. All rights reserved.
-# Copyright (C) 2013-2014 Steve Hay. All rights reserved.
+# Copyright (C) 2013-2014, 2020 Steve Hay. All rights reserved.
# This module is free software; you can redistribute it and/or modify it under
# the same terms as Perl itself, i.e. under the terms of either the GNU General
# Public License or the Artistic License, as specified in the F<LICENCE> file.
@@ -16,7 +16,7 @@ use warnings;
use Carp;
use FileHandle;
-our $VERSION = "3.11";
+our $VERSION = "3.12";
our $TESTING;
@@ -224,7 +224,7 @@ second the ownership permissions should be such that only the owner has
read and write access. If these conditions are not met then a warning is
output and the .netrc file is not read.
-=head1 THE .netrc FILE
+=head2 The F<.netrc> File
The .netrc file contains login and initialization information used by the
auto-login process. It resides in the user's home directory. The following
@@ -276,7 +276,7 @@ with I<ftp>.
=back
-=head1 CONSTRUCTOR
+=head2 Class Methods
The constructor for a C<Net::Netrc> object is not called new as it does not
really create a new object. But instead is called C<lookup> as this is
@@ -284,11 +284,11 @@ essentially what it does.
=over 4
-=item lookup ( MACHINE [, LOGIN ])
+=item C<lookup($machine[, $login])>
-Lookup and return a reference to the entry for C<MACHINE>. If C<LOGIN> is given
-then the entry returned will have the given login. If C<LOGIN> is not given then
-the first entry in the .netrc file for C<MACHINE> will be returned.
+Lookup and return a reference to the entry for C<$machine>. If C<$login> is given
+then the entry returned will have the given login. If C<$login> is not given then
+the first entry in the .netrc file for C<$machine> will be returned.
If a matching entry cannot be found, and a default entry exists, then a
reference to the default entry is returned.
@@ -298,45 +298,52 @@ no .netrc file is found, then C<undef> is returned.
=back
-=head1 METHODS
+=head2 Object Methods
=over 4
-=item login ()
+=item C<login()>
Return the login id for the netrc entry
-=item password ()
+=item C<password()>
Return the password for the netrc entry
-=item account ()
+=item C<account()>
Return the account information for the netrc entry
-=item lpa ()
+=item C<lpa()>
Return a list of login, password and account information for the netrc entry
=back
-=head1 AUTHOR
+=head1 EXPORTS
+
+I<None>.
-Graham Barr E<lt>F<gbarr@pobox.com>E<gt>.
+=head1 KNOWN BUGS
-Steve Hay E<lt>F<shay@cpan.org>E<gt> is now maintaining libnet as of version
-1.22_02.
+See L<https://rt.cpan.org/Dist/Display.html?Status=Active&Queue=libnet>.
=head1 SEE ALSO
-L<Net::Netrc>,
-L<Net::Cmd>
+L<Net::Cmd>.
+
+=head1 AUTHOR
+
+Graham Barr E<lt>L<gbarr@pobox.com|mailto:gbarr@pobox.com>E<gt>.
+
+Steve Hay E<lt>L<shay@cpan.org|mailto:shay@cpan.org>E<gt> is now maintaining
+libnet as of version 1.22_02.
=head1 COPYRIGHT
Copyright (C) 1995-1998 Graham Barr. All rights reserved.
-Copyright (C) 2013-2014 Steve Hay. All rights reserved.
+Copyright (C) 2013-2014, 2020 Steve Hay. All rights reserved.
=head1 LICENCE
@@ -344,4 +351,16 @@ This module is free software; you can redistribute it and/or modify it under the
same terms as Perl itself, i.e. under the terms of either the GNU General Public
License or the Artistic License, as specified in the F<LICENCE> file.
+=head1 VERSION
+
+Version 3.12
+
+=head1 DATE
+
+09 Dec 2020
+
+=head1 HISTORY
+
+See the F<Changes> file.
+
=cut
diff --git a/cpan/libnet/lib/Net/POP3.pm b/cpan/libnet/lib/Net/POP3.pm
index 0811025b0a..fb442ad3c1 100644
--- a/cpan/libnet/lib/Net/POP3.pm
+++ b/cpan/libnet/lib/Net/POP3.pm
@@ -1,7 +1,7 @@
# Net::POP3.pm
#
# Copyright (C) 1995-2004 Graham Barr. All rights reserved.
-# Copyright (C) 2013-2016 Steve Hay. All rights reserved.
+# Copyright (C) 2013-2016, 2020 Steve Hay. All rights reserved.
# This module is free software; you can redistribute it and/or modify it under
# the same terms as Perl itself, i.e. under the terms of either the GNU General
# Public License or the Artistic License, as specified in the F<LICENCE> file.
@@ -18,7 +18,7 @@ use IO::Socket;
use Net::Cmd;
use Net::Config;
-our $VERSION = "3.11";
+our $VERSION = "3.12";
# Code for detecting if we can use SSL
my $ssl_class = eval {
@@ -124,7 +124,7 @@ sub debug_text { $_[2] =~ /^(pass|rpop)/i ? "$1 ....\n" : $_[2]; }
sub login {
- @_ >= 1 && @_ <= 3 or croak 'usage: $pop3->login( USER, PASS )';
+ @_ >= 1 && @_ <= 3 or croak 'usage: $pop3->login([$user[, $pass]])';
my ($me, $user, $pass) = @_;
if (@_ <= 2) {
@@ -147,7 +147,7 @@ sub starttls {
}
sub apop {
- @_ >= 1 && @_ <= 3 or croak 'usage: $pop3->apop( USER, PASS )';
+ @_ >= 1 && @_ <= 3 or croak 'usage: $pop3->apop([$user[, $pass]])';
my ($me, $user, $pass) = @_;
my $banner;
my $md;
@@ -180,13 +180,13 @@ sub apop {
sub user {
- @_ == 2 or croak 'usage: $pop3->user( USER )';
+ @_ == 2 or croak 'usage: $pop3->user($user)';
$_[0]->_USER($_[1]) ? 1 : undef;
}
sub pass {
- @_ == 2 or croak 'usage: $pop3->pass( PASS )';
+ @_ == 2 or croak 'usage: $pop3->pass($pass)';
my ($me, $pass) = @_;
@@ -225,7 +225,7 @@ sub last {
sub top {
- @_ == 2 || @_ == 3 or croak 'usage: $pop3->top( MSGNUM [, NUMLINES ])';
+ @_ == 2 || @_ == 3 or croak 'usage: $pop3->top($msgnum[, $numlines])';
my $me = shift;
return
@@ -247,7 +247,7 @@ sub popstat {
sub list {
- @_ == 1 || @_ == 2 or croak 'usage: $pop3->list( [ MSGNUM ] )';
+ @_ == 1 || @_ == 2 or croak 'usage: $pop3->list([$msgnum])';
my $me = shift;
return
@@ -268,7 +268,7 @@ sub list {
sub get {
- @_ == 2 or @_ == 3 or croak 'usage: $pop3->get( MSGNUM [, FH ])';
+ @_ == 2 or @_ == 3 or croak 'usage: $pop3->get($msgnum[, $fh])';
my $me = shift;
return
@@ -279,7 +279,7 @@ sub get {
sub getfh {
- @_ == 2 or croak 'usage: $pop3->getfh( MSGNUM )';
+ @_ == 2 or croak 'usage: $pop3->getfh($msgnum)';
my $me = shift;
return unless $me->_RETR(shift);
@@ -288,7 +288,7 @@ sub getfh {
sub delete {
- @_ == 2 or croak 'usage: $pop3->delete( MSGNUM )';
+ @_ == 2 or croak 'usage: $pop3->delete($msgnum)';
my $me = shift;
return 0 unless $me->_DELE(@_);
${*$me}{'net_pop3_deleted'} = 1;
@@ -296,7 +296,7 @@ sub delete {
sub uidl {
- @_ == 1 || @_ == 2 or croak 'usage: $pop3->uidl( [ MSGNUM ] )';
+ @_ == 1 || @_ == 2 or croak 'usage: $pop3->uidl([$msgnum])';
my $me = shift;
my $uidl;
@@ -319,7 +319,7 @@ sub uidl {
sub ping {
- @_ == 2 or croak 'usage: $pop3->ping( USER )';
+ @_ == 2 or croak 'usage: $pop3->ping($user)';
my $me = shift;
return () unless $me->_PING(@_) && $me->message =~ /(\d+)\D+(\d+)/;
@@ -635,21 +635,20 @@ on the object.
The Net::POP3 class is a subclass of Net::Cmd and (depending on avaibility) of
IO::Socket::IP, IO::Socket::INET6 or IO::Socket::INET.
-
-=head1 CONSTRUCTOR
+=head2 Class Methods
=over 4
-=item new ( [ HOST ] [, OPTIONS ] )
+=item C<new([$host][, %options])>
-This is the constructor for a new Net::POP3 object. C<HOST> is the
+This is the constructor for a new Net::POP3 object. C<$host> is the
name of the remote host to which an POP3 connection is required.
-C<HOST> is optional. If C<HOST> is not given then it may instead be
+C<$host> is optional. If C<$host> is not given then it may instead be
passed as the C<Host> option described below. If neither is given then
the C<POP3_Hosts> specified in C<Net::Config> will be used.
-C<OPTIONS> are passed in a hash like fashion, using key and value pairs.
+C<%options> are passed in a hash like fashion, using key and value pairs.
Possible options are:
B<Host> - POP3 host to connect to. It may be a single scalar, as defined for
@@ -681,7 +680,7 @@ B<Debug> - Enable debugging information
=back
-=head1 METHODS
+=head2 Object Methods
Unless otherwise stated all methods return either a I<true> or I<false>
value, with I<true> meaning that the operation was a success. When a method
@@ -694,26 +693,26 @@ documented here.
=over 4
-=item host ()
+=item C<host()>
Returns the value used by the constructor, and passed to IO::Socket::INET,
to connect to the host.
-=item auth ( USERNAME, PASSWORD )
+=item C<auth($username, $password)>
Attempt SASL authentication.
-=item user ( USER )
+=item C<user($user)>
Send the USER command.
-=item pass ( PASS )
+=item C<pass($pass)>
Send the PASS command. Returns the number of messages in the mailbox.
-=item login ( [ USER [, PASS ]] )
+=item C<login([$user[, $pass]])>
-Send both the USER and PASS commands. If C<PASS> is not given the
+Send both the USER and PASS commands. If C<$pass> is not given the
C<Net::POP3> uses C<Net::Netrc> to lookup the password using the host
and username. If the username is not specified then the current user name
will be used.
@@ -724,25 +723,25 @@ will give a true value in a boolean context, but zero in a numeric context.
If there was an error authenticating the user then I<undef> will be returned.
-=item starttls ( SSLARGS )
+=item C<starttls(%sslargs)>
Upgrade existing plain connection to SSL.
You can use SSL arguments as documented in L<IO::Socket::SSL>, but it will
usually use the right arguments already.
-=item apop ( [ USER [, PASS ]] )
+=item C<apop([$user[, $pass]])>
-Authenticate with the server identifying as C<USER> with password C<PASS>.
+Authenticate with the server identifying as C<$user> with password C<$pass>.
Similar to L</login>, but the password is not sent in clear text.
To use this method you must have the Digest::MD5 or the MD5 module installed,
otherwise this method will return I<undef>.
-=item banner ()
+=item C<banner()>
Return the sever's connection banner
-=item capa ()
+=item C<capa()>
Return a reference to a hash of the capabilities of the server. APOP
is added as a pseudo capability. Note that I've been unable to
@@ -750,109 +749,117 @@ find a list of the standard capability values, and some appear to
be multi-word and some are not. We make an attempt at intelligently
parsing them, but it may not be correct.
-=item capabilities ()
+=item C<capabilities()>
Just like capa, but only uses a cache from the last time we asked
the server, so as to avoid asking more than once.
-=item top ( MSGNUM [, NUMLINES ] )
+=item C<top($msgnum[, $numlines])>
-Get the header and the first C<NUMLINES> of the body for the message
-C<MSGNUM>. Returns a reference to an array which contains the lines of text
+Get the header and the first C<$numlines> of the body for the message
+C<$msgnum>. Returns a reference to an array which contains the lines of text
read from the server.
-=item list ( [ MSGNUM ] )
+=item C<list([$msgnum])>
If called with an argument the C<list> returns the size of the message
in octets.
If called without arguments a reference to a hash is returned. The
-keys will be the C<MSGNUM>'s of all undeleted messages and the values will
+keys will be the C<$msgnum>'s of all undeleted messages and the values will
be their size in octets.
-=item get ( MSGNUM [, FH ] )
+=item C<get($msgnum[, $fh])>
-Get the message C<MSGNUM> from the remote mailbox. If C<FH> is not given
+Get the message C<$msgnum> from the remote mailbox. If C<$fh> is not given
then get returns a reference to an array which contains the lines of
-text read from the server. If C<FH> is given then the lines returned
-from the server are printed to the filehandle C<FH>.
+text read from the server. If C<$fh> is given then the lines returned
+from the server are printed to the filehandle C<$fh>.
-=item getfh ( MSGNUM )
+=item C<getfh($msgnum)>
As per get(), but returns a tied filehandle. Reading from this
filehandle returns the requested message. The filehandle will return
EOF at the end of the message and should not be reused.
-=item last ()
+=item C<last()>
-Returns the highest C<MSGNUM> of all the messages accessed.
+Returns the highest C<$msgnum> of all the messages accessed.
-=item popstat ()
+=item C<popstat()>
Returns a list of two elements. These are the number of undeleted
elements and the size of the mbox in octets.
-=item ping ( USER )
+=item C<ping($user)>
Returns a list of two elements. These are the number of new messages
-and the total number of messages for C<USER>.
+and the total number of messages for C<$user>.
-=item uidl ( [ MSGNUM ] )
+=item C<uidl([$msgnum])>
-Returns a unique identifier for C<MSGNUM> if given. If C<MSGNUM> is not
+Returns a unique identifier for C<$msgnum> if given. If C<$msgnum> is not
given C<uidl> returns a reference to a hash where the keys are the
message numbers and the values are the unique identifiers.
-=item delete ( MSGNUM )
+=item C<delete($msgnum)>
-Mark message C<MSGNUM> to be deleted from the remote mailbox. All messages
+Mark message C<$msgnum> to be deleted from the remote mailbox. All messages
that are marked to be deleted will be removed from the remote mailbox
when the server connection closed.
-=item reset ()
+=item C<reset()>
Reset the status of the remote POP3 server. This includes resetting the
status of all messages to not be deleted.
-=item quit ()
+=item C<quit()>
Quit and close the connection to the remote POP3 server. Any messages marked
as deleted will be deleted from the remote mailbox.
-=item can_inet6 ()
+=item C<can_inet6()>
Returns whether we can use IPv6.
-=item can_ssl ()
+=item C<can_ssl()>
Returns whether we can use SSL.
=back
-=head1 NOTES
+=head2 Notes
If a C<Net::POP3> object goes out of scope before C<quit> method is called
then the C<reset> method will called before the connection is closed. This
means that any messages marked to be deleted will not be.
+=head1 EXPORTS
+
+I<None>.
+
+=head1 KNOWN BUGS
+
+See L<https://rt.cpan.org/Dist/Display.html?Status=Active&Queue=libnet>.
+
=head1 SEE ALSO
L<Net::Netrc>,
L<Net::Cmd>,
-L<IO::Socket::SSL>
+L<IO::Socket::SSL>.
=head1 AUTHOR
-Graham Barr E<lt>F<gbarr@pobox.com>E<gt>.
+Graham Barr E<lt>L<gbarr@pobox.com|mailto:gbarr@pobox.com>E<gt>.
-Steve Hay E<lt>F<shay@cpan.org>E<gt> is now maintaining libnet as of version
-1.22_02.
+Steve Hay E<lt>L<shay@cpan.org|mailto:shay@cpan.org>E<gt> is now maintaining
+libnet as of version 1.22_02.
=head1 COPYRIGHT
Copyright (C) 1995-2004 Graham Barr. All rights reserved.
-Copyright (C) 2013-2016 Steve Hay. All rights reserved.
+Copyright (C) 2013-2016, 2020 Steve Hay. All rights reserved.
=head1 LICENCE
@@ -860,4 +867,16 @@ This module is free software; you can redistribute it and/or modify it under the
same terms as Perl itself, i.e. under the terms of either the GNU General Public
License or the Artistic License, as specified in the F<LICENCE> file.
+=head1 VERSION
+
+Version 3.12
+
+=head1 DATE
+
+09 Dec 2020
+
+=head1 HISTORY
+
+See the F<Changes> file.
+
=cut
diff --git a/cpan/libnet/lib/Net/SMTP.pm b/cpan/libnet/lib/Net/SMTP.pm
index 5eaf4220b6..fd81d0be97 100644
--- a/cpan/libnet/lib/Net/SMTP.pm
+++ b/cpan/libnet/lib/Net/SMTP.pm
@@ -1,7 +1,7 @@
# Net::SMTP.pm
#
# Copyright (C) 1995-2004 Graham Barr. All rights reserved.
-# Copyright (C) 2013-2016 Steve Hay. All rights reserved.
+# Copyright (C) 2013-2016, 2020 Steve Hay. All rights reserved.
# This module is free software; you can redistribute it and/or modify it under
# the same terms as Perl itself, i.e. under the terms of either the GNU General
# Public License or the Artistic License, as specified in the F<LICENCE> file.
@@ -19,7 +19,7 @@ use Net::Cmd;
use Net::Config;
use Socket;
-our $VERSION = "3.11";
+our $VERSION = "3.12";
# Code for detecting if we can use SSL
my $ssl_class = eval {
@@ -663,57 +663,23 @@ explicit TLS encryption, i.e. SMTPS or SMTP+STARTTLS.
The Net::SMTP class is a subclass of Net::Cmd and (depending on avaibility) of
IO::Socket::IP, IO::Socket::INET6 or IO::Socket::INET.
-=head1 EXAMPLES
-
-This example prints the mail domain name of the SMTP server known as mailhost:
-
- #!/usr/local/bin/perl -w
-
- use Net::SMTP;
-
- $smtp = Net::SMTP->new('mailhost');
- print $smtp->domain,"\n";
- $smtp->quit;
-
-This example sends a small message to the postmaster at the SMTP server
-known as mailhost:
-
- #!/usr/local/bin/perl -w
-
- use Net::SMTP;
-
- my $smtp = Net::SMTP->new('mailhost');
-
- $smtp->mail($ENV{USER});
- if ($smtp->to('postmaster')) {
- $smtp->data();
- $smtp->datasend("To: postmaster\n");
- $smtp->datasend("\n");
- $smtp->datasend("A simple test message\n");
- $smtp->dataend();
- } else {
- print "Error: ", $smtp->message();
- }
-
- $smtp->quit;
-
-=head1 CONSTRUCTOR
+=head2 Class Methods
=over 4
-=item new ( [ HOST ] [, OPTIONS ] )
+=item C<new([$host][, %options])>
-This is the constructor for a new Net::SMTP object. C<HOST> is the
+This is the constructor for a new Net::SMTP object. C<$host> is the
name of the remote host to which an SMTP connection is required.
On failure C<undef> will be returned and C<$@> will contain the reason
for the failure.
-C<HOST> is optional. If C<HOST> is not given then it may instead be
+C<$host> is optional. If C<$host> is not given then it may instead be
passed as the C<Host> option described below. If neither is given then
the C<SMTP_Hosts> specified in C<Net::Config> will be used.
-C<OPTIONS> are passed in a hash like fashion, using key and value pairs.
+C<%options> are passed in a hash like fashion, using key and value pairs.
Possible options are:
B<Hello> - SMTP requires that you identify yourself. This option
@@ -748,16 +714,14 @@ class. Alternatively B<Family> can be used.
B<Timeout> - Maximum time, in seconds, to wait for a response from the
SMTP server (default: 120)
-B<ExactAddresses> - If true the all ADDRESS arguments must be as
+B<ExactAddresses> - If true then all C<$address> arguments must be as
defined by C<addr-spec> in RFC2822. If not given, or false, then
Net::SMTP will attempt to extract the address from the value passed.
B<Debug> - Enable debugging information
-
Example:
-
$smtp = Net::SMTP->new('mailhost',
Hello => 'my.mail.domain',
Timeout => 30,
@@ -788,7 +752,7 @@ Example:
=back
-=head1 METHODS
+=head1 Object Methods
Unless otherwise stated all methods return either a I<true> or I<false>
value, with I<true> meaning that the operation was a success. When a method
@@ -801,60 +765,60 @@ documented here.
=over 4
-=item banner ()
+=item C<banner()>
Returns the banner message which the server replied with when the
initial connection was made.
-=item domain ()
+=item C<domain()>
Returns the domain that the remote SMTP server identified itself as during
connection.
-=item hello ( DOMAIN )
+=item C<hello($domain)>
Tell the remote server the mail domain which you are in using the EHLO
command (or HELO if EHLO fails). Since this method is invoked
automatically when the Net::SMTP object is constructed the user should
normally not have to call it manually.
-=item host ()
+=item C<host()>
Returns the value used by the constructor, and passed to IO::Socket::INET,
to connect to the host.
-=item etrn ( DOMAIN )
+=item C<etrn($domain)>
-Request a queue run for the DOMAIN given.
+Request a queue run for the C<$domain> given.
-=item starttls ( SSLARGS )
+=item C<starttls(%sslargs)>
Upgrade existing plain connection to SSL.
You can use SSL arguments as documented in L<IO::Socket::SSL>, but it will
usually use the right arguments already.
-=item auth ( USERNAME, PASSWORD )
+=item C<auth($username, $password)>
-=item auth ( SASL )
+=item C<auth($sasl)>
Attempt SASL authentication. Requires Authen::SASL module. The first form
constructs a new Authen::SASL object using the given username and password;
the second form uses the given Authen::SASL object.
-=item mail ( ADDRESS [, OPTIONS] )
+=item C<mail($address[, %options])>
-=item send ( ADDRESS )
+=item C<send($address)>
-=item send_or_mail ( ADDRESS )
+=item C<send_or_mail($address)>
-=item send_and_mail ( ADDRESS )
+=item C<send_and_mail($address)>
-Send the appropriate command to the server MAIL, SEND, SOML or SAML. C<ADDRESS>
+Send the appropriate command to the server MAIL, SEND, SOML or SAML. C<$address>
is the address of the sender. This initiates the sending of a message. The
method C<recipient> should be called for each address that the message is to
be sent to.
-The C<mail> method can some additional ESMTP OPTIONS which is passed
+The C<mail> method can take some additional ESMTP C<%options> which is passed
in hash like fashion, using key and value pairs. Possible options are:
Size => <bytes>
@@ -872,13 +836,13 @@ Status Notification).
The submitter address in C<AUTH> option is expected to be in a format as
required by RFC 2554, in an RFC2821-quoted form and xtext-encoded, or <> .
-=item reset ()
+=item C<reset()>
Reset the status of the server. This may be called after a message has been
initiated, but before any data has been sent, to cancel the sending of the
message.
-=item recipient ( ADDRESS [, ADDRESS, [...]] [, OPTIONS ] )
+=item C<recipient($address[, $address[, ...]][, %options])>
Notify the server that the current message should be sent to all of the
addresses given. Each address is sent as a separate command to the server.
@@ -886,7 +850,7 @@ Should the sending of any address result in a failure then the process is
aborted and a I<false> value is returned. It is up to the user to call
C<reset> if they so desire.
-The C<recipient> method can also pass additional case-sensitive OPTIONS as an
+The C<recipient> method can also pass additional case-sensitive C<%options> as an
anonymous hash using key and value pairs. Possible options are:
Notify => ['NEVER'] or ['SUCCESS','FAILURE','DELAY'] (see below)
@@ -919,8 +883,9 @@ that a DSN not be returned to the sender under any conditions."
$smtp->recipient(@recipients, { Notify => ['NEVER'], SkipBad => 1 }); # Good
You may use any combination of these three values 'SUCCESS','FAILURE','DELAY' in
-the anonymous array reference as defined by RFC3461 (see http://www.ietf.org/rfc/rfc3461.txt
-for more information. Note: quotations in this topic from same.).
+the anonymous array reference as defined by RFC3461 (see
+L<https://www.ietf.org/rfc/rfc3461.txt> for more information. Note: quotations
+in this topic from same.).
A Notify parameter of 'SUCCESS' or 'FAILURE' "requests that a DSN be issued on
successful delivery or delivery failure, respectively."
@@ -943,67 +908,67 @@ sent to. The machine that generates a DSN will use this address to inform
the sender, because he can't know if recipients get rewritten by mail servers.
It is expected to be in a format as required by RFC3461, xtext-encoded.
-=item to ( ADDRESS [, ADDRESS [...]] )
+=item C<to($address[, $address[, ...]])>
-=item cc ( ADDRESS [, ADDRESS [...]] )
+=item C<cc($address[, $address[, ...]])>
-=item bcc ( ADDRESS [, ADDRESS [...]] )
+=item C<bcc($address[, $address[, ...]])>
Synonyms for C<recipient>.
-=item data ( [ DATA ] )
+=item C<data([$data])>
Initiate the sending of the data from the current message.
-C<DATA> may be a reference to a list or a list and must be encoded by the
+C<$data> may be a reference to a list or a list and must be encoded by the
caller to octets of whatever encoding is required, e.g. by using the Encode
module's C<encode()> function.
-If specified the contents of C<DATA> and a termination string C<".\r\n"> is
+If specified the contents of C<$data> and a termination string C<".\r\n"> is
sent to the server. The result will be true if the data was accepted.
-If C<DATA> is not specified then the result will indicate that the server
+If C<$data> is not specified then the result will indicate that the server
wishes the data to be sent. The data must then be sent using the C<datasend>
and C<dataend> methods described in L<Net::Cmd>.
-=item bdat ( DATA )
+=item C<bdat($data)>
-=item bdatlast ( DATA )
+=item C<bdatlast($data)>
-Use the alternate DATA command "BDAT" of the data chunking service extension
+Use the alternate C<$data> command "BDAT" of the data chunking service extension
defined in RFC1830 for efficiently sending large MIME messages.
-=item expand ( ADDRESS )
+=item C<expand($address)>
Request the server to expand the given address Returns an array
which contains the text read from the server.
-=item verify ( ADDRESS )
+=item C<verify($address)>
-Verify that C<ADDRESS> is a legitimate mailing address.
+Verify that C<$address> is a legitimate mailing address.
Most sites usually disable this feature in their SMTP service configuration.
Use "Debug => 1" option under new() to see if disabled.
-=item help ( [ $subject ] )
+=item C<help([$subject])>
Request help text from the server. Returns the text or undef upon failure
-=item quit ()
+=item C<quit()>
Send the QUIT command to the remote SMTP server and close the socket connection.
-=item can_inet6 ()
+=item C<can_inet6()>
Returns whether we can use IPv6.
-=item can_ssl ()
+=item C<can_ssl()>
Returns whether we can use SSL.
=back
-=head1 ADDRESSES
+=head2 Addresses
Net::SMTP attempts to DWIM with addresses that are passed. For
example an application might extract The From: line from an email
@@ -1019,23 +984,65 @@ accept the address surrounded by angle brackets.
"funny user"@domain RIGHT, recommended
<"funny user"@domain> OK
+=head1 EXAMPLES
+
+This example prints the mail domain name of the SMTP server known as mailhost:
+
+ #!/usr/local/bin/perl -w
+
+ use Net::SMTP;
+
+ $smtp = Net::SMTP->new('mailhost');
+ print $smtp->domain,"\n";
+ $smtp->quit;
+
+This example sends a small message to the postmaster at the SMTP server
+known as mailhost:
+
+ #!/usr/local/bin/perl -w
+
+ use Net::SMTP;
+
+ my $smtp = Net::SMTP->new('mailhost');
+
+ $smtp->mail($ENV{USER});
+ if ($smtp->to('postmaster')) {
+ $smtp->data();
+ $smtp->datasend("To: postmaster\n");
+ $smtp->datasend("\n");
+ $smtp->datasend("A simple test message\n");
+ $smtp->dataend();
+ } else {
+ print "Error: ", $smtp->message();
+ }
+
+ $smtp->quit;
+
+=head1 EXPORTS
+
+I<None>.
+
+=head1 KNOWN BUGS
+
+See L<https://rt.cpan.org/Dist/Display.html?Status=Active&Queue=libnet>.
+
=head1 SEE ALSO
L<Net::Cmd>,
-L<IO::Socket::SSL>
+L<IO::Socket::SSL>.
=head1 AUTHOR
-Graham Barr E<lt>F<gbarr@pobox.com>E<gt>.
+Graham Barr E<lt>L<gbarr@pobox.com|mailto:gbarr@pobox.com>E<gt>.
-Steve Hay E<lt>F<shay@cpan.org>E<gt> is now maintaining libnet as of version
-1.22_02.
+Steve Hay E<lt>L<shay@cpan.org|mailto:shay@cpan.org>E<gt> is now maintaining
+libnet as of version 1.22_02.
=head1 COPYRIGHT
Copyright (C) 1995-2004 Graham Barr. All rights reserved.
-Copyright (C) 2013-2016 Steve Hay. All rights reserved.
+Copyright (C) 2013-2016, 2020 Steve Hay. All rights reserved.
=head1 LICENCE
@@ -1043,4 +1050,16 @@ This module is free software; you can redistribute it and/or modify it under the
same terms as Perl itself, i.e. under the terms of either the GNU General Public
License or the Artistic License, as specified in the F<LICENCE> file.
+=head1 VERSION
+
+Version 3.12
+
+=head1 DATE
+
+09 Dec 2020
+
+=head1 HISTORY
+
+See the F<Changes> file.
+
=cut
diff --git a/cpan/libnet/lib/Net/Time.pm b/cpan/libnet/lib/Net/Time.pm
index d049408538..4ce1daf120 100644
--- a/cpan/libnet/lib/Net/Time.pm
+++ b/cpan/libnet/lib/Net/Time.pm
@@ -1,7 +1,7 @@
# Net::Time.pm
#
# Copyright (C) 1995-2004 Graham Barr. All rights reserved.
-# Copyright (C) 2014 Steve Hay. All rights reserved.
+# Copyright (C) 2014, 2020 Steve Hay. All rights reserved.
# This module is free software; you can redistribute it and/or modify it under
# the same terms as Perl itself, i.e. under the terms of either the GNU General
# Public License or the Artistic License, as specified in the F<LICENCE> file.
@@ -22,7 +22,7 @@ use Net::Config;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(inet_time inet_daytime);
-our $VERSION = "3.11";
+our $VERSION = "3.12";
our $TIMEOUT = 120;
@@ -123,37 +123,64 @@ Net::Time - time and daytime network client interface
C<Net::Time> provides subroutines that obtain the time on a remote machine.
+=head2 Functions
+
=over 4
-=item inet_time ( [HOST [, PROTOCOL [, TIMEOUT]]])
+=item C<inet_time([$host[, $protocol[, $timeout]]])>
-Obtain the time on C<HOST>, or some default host if C<HOST> is not given
+Obtain the time on C<$host>, or some default host if C<$host> is not given
or not defined, using the protocol as defined in RFC868. The optional
-argument C<PROTOCOL> should define the protocol to use, either C<tcp> or
+argument C<$protocol> should define the protocol to use, either C<tcp> or
C<udp>. The result will be a time value in the same units as returned
by time() or I<undef> upon failure.
-=item inet_daytime ( [HOST [, PROTOCOL [, TIMEOUT]]])
+=item C<inet_daytime([$host[, $protocol[, $timeout]]])>
-Obtain the time on C<HOST>, or some default host if C<HOST> is not given
+Obtain the time on C<$host>, or some default host if C<$host> is not given
or not defined, using the protocol as defined in RFC867. The optional
-argument C<PROTOCOL> should define the protocol to use, either C<tcp> or
+argument C<$protocol> should define the protocol to use, either C<tcp> or
C<udp>. The result will be an ASCII string or I<undef> upon failure.
=back
+=head1 EXPORTS
+
+The following symbols are, or can be, exported by this module:
+
+=over 4
+
+=item Default Exports
+
+I<None>.
+
+=item Optional Exports
+
+C<inet_time>,
+C<inet_daytime>.
+
+=item Export Tags
+
+I<None>.
+
+=back
+
+=head1 KNOWN BUGS
+
+I<None>.
+
=head1 AUTHOR
-Graham Barr E<lt>F<gbarr@pobox.com>E<gt>.
+Graham Barr E<lt>L<gbarr@pobox.com|mailto:gbarr@pobox.com>E<gt>.
-Steve Hay E<lt>F<shay@cpan.org>E<gt> is now maintaining libnet as of version
-1.22_02.
+Steve Hay E<lt>L<shay@cpan.org|mailto:shay@cpan.org>E<gt> is now maintaining
+libnet as of version 1.22_02.
=head1 COPYRIGHT
Copyright (C) 1995-2004 Graham Barr. All rights reserved.
-Copyright (C) 2014 Steve Hay. All rights reserved.
+Copyright (C) 2014, 2020 Steve Hay. All rights reserved.
=head1 LICENCE
@@ -161,4 +188,16 @@ This module is free software; you can redistribute it and/or modify it under the
same terms as Perl itself, i.e. under the terms of either the GNU General Public
License or the Artistic License, as specified in the F<LICENCE> file.
+=head1 VERSION
+
+Version 3.12
+
+=head1 DATE
+
+09 Dec 2020
+
+=head1 HISTORY
+
+See the F<Changes> file.
+
=cut
diff --git a/cpan/libnet/lib/Net/libnetFAQ.pod b/cpan/libnet/lib/Net/libnetFAQ.pod
index bcc53479ba..4a3b183cd1 100644
--- a/cpan/libnet/lib/Net/libnetFAQ.pod
+++ b/cpan/libnet/lib/Net/libnetFAQ.pod
@@ -9,23 +9,25 @@ libnetFAQ - libnet Frequently Asked Questions
This document is distributed with the libnet distribution, and is also
available on the libnet web page at
- http://search.cpan.org/dist/libnet/
+L<https://metacpan.org/release/libnet>
=head2 How to contribute to this document
You may report corrections, additions, and suggestions on the
CPAN Request Tracker at
- http://rt.cpan.org/Public/Bug/Report.html?Queue=libnet
+L<https://rt.cpan.org/Public/Bug/Report.html?Queue=libnet>
=head1 Author and Copyright Information
Copyright (C) 1997-1998 Graham Barr. All rights reserved.
-This document is free; you can redistribute it and/or modify it
-under the terms of the Artistic License.
+This document is free; you can redistribute it and/or modify it under
+the same terms as Perl itself, i.e. under the terms of either the GNU
+General Public License or the Artistic License, as specified in the
+F<LICENCE> file.
-Steve Hay E<lt>F<shay@cpan.org>E<gt> is now maintaining libnet as of version
-1.22_02.
+Steve Hay E<lt>L<shay@cpan.org|mailto:shay@cpan.org>E<gt> is now maintaining
+libnet as of version 1.22_02.
=head2 Disclaimer
@@ -70,7 +72,7 @@ on any machine that perl runs on.
The latest libnet release is always on CPAN, you will find it
in
- http://search.cpan.org/dist/libnet/
+L<https://metacpan.org/release/libnet>
=head1 Using Net::FTP
diff --git a/cpan/libnet/t/config.t b/cpan/libnet/t/config.t
index 3c29a03d0d..897ca211c0 100644
--- a/cpan/libnet/t/config.t
+++ b/cpan/libnet/t/config.t
@@ -5,15 +5,21 @@ use 5.008001;
use strict;
use warnings;
+use Test::More;
+
BEGIN {
if (!eval { require Socket }) {
- print "1..0 # no Socket\n"; exit 0;
+ plan skip_all => "no Socket";
+ }
+ elsif (ord('A') == 193 && !eval { require Convert::EBCDIC }) {
+ plan skip_all => "EBCDIC but no Convert::EBCDIC";
+ }
+ else {
+ plan tests => 10;
}
+
undef *{Socket::inet_aton};
undef *{Socket::inet_ntoa};
- if (ord('A') == 193 && !eval { require Convert::EBCDIC }) {
- print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0;
- }
$INC{'Socket.pm'} = 1;
}
@@ -45,13 +51,8 @@ sub inet_ntoa {
return $names{$_[0]};
}
-package main;
-
-(my $libnet_t = __FILE__) =~ s/config.t/libnet_t.pl/;
-require $libnet_t;
-
-print "1..10\n";
+package main;
use Net::Config;
ok( exists $INC{'Net/Config.pm'}, 'Net::Config should have been used' );
diff --git a/cpan/libnet/t/datasend.t b/cpan/libnet/t/datasend.t
index 0aea9d4a39..7902c17d47 100644
--- a/cpan/libnet/t/datasend.t
+++ b/cpan/libnet/t/datasend.t
@@ -5,12 +5,17 @@ use 5.008001;
use strict;
use warnings;
+use Test::More;
+
BEGIN {
if (!eval { require Socket }) {
- print "1..0 # no Socket\n"; exit 0;
+ plan skip_all => "no Socket";
+ }
+ elsif (ord('A') == 193 && !eval { require Convert::EBCDIC }) {
+ plan skip_all => "EBCDIC but no Convert::EBCDIC";
}
- if (ord('A') == 193 && !eval { require Convert::EBCDIC }) {
- print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0;
+ else {
+ plan tests => 54;
}
}
@@ -41,11 +46,6 @@ BEGIN {
}
}
-(my $libnet_t = __FILE__) =~ s/datasend.t/libnet_t.pl/;
-require $libnet_t or die;
-
-print "1..54\n";
-
sub check {
my $expect = pop;
my $cmd = Foo->new;
diff --git a/cpan/libnet/t/ftp.t b/cpan/libnet/t/ftp.t
index 16cb868460..69af504a52 100644
--- a/cpan/libnet/t/ftp.t
+++ b/cpan/libnet/t/ftp.t
@@ -7,7 +7,7 @@ use warnings;
BEGIN {
if (!eval { require Socket }) {
- print "1..0 # Skip: no Socket module\n"; exit 0;
+ print "1..0 # Skip: no Socket\n"; exit 0;
}
if (ord('A') == 193 && !eval { require Convert::EBCDIC }) {
print "1..0 # Skip: EBCDIC but no Convert::EBCDIC\n"; exit 0;
diff --git a/cpan/libnet/t/hostname.t b/cpan/libnet/t/hostname.t
index 55031bf345..5e20b819a9 100644
--- a/cpan/libnet/t/hostname.t
+++ b/cpan/libnet/t/hostname.t
@@ -7,10 +7,10 @@ use warnings;
BEGIN {
if (!eval { require Socket }) {
- print "1..0 # no Socket\n"; exit 0;
+ print "1..0 # Skip: no Socket\n"; exit 0;
}
if (ord('A') == 193 && !eval { require Convert::EBCDIC }) {
- print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0;
+ print "1..0 # Skip: EBCDIC but no Convert::EBCDIC\n"; exit 0;
}
}
@@ -18,7 +18,7 @@ use Net::Domain qw(hostname domainname hostdomain hostfqdn);
use Net::Config;
unless($NetConfig{test_hosts}) {
- print "1..0\n";
+ print "1..0 # Skip: test_hosts not enabled in config\n";
exit 0;
}
diff --git a/cpan/libnet/t/libnet_t.pl b/cpan/libnet/t/libnet_t.pl
deleted file mode 100644
index cc512ca592..0000000000
--- a/cpan/libnet/t/libnet_t.pl
+++ /dev/null
@@ -1,41 +0,0 @@
-use 5.008001;
-
-use strict;
-use warnings;
-
-my $number = 0;
-sub ok {
- my ($condition, $name) = @_;
-
- my $message = $condition ? "ok " : "not ok ";
- $message .= ++$number;
- $message .= " # $name" if defined $name;
- print $message, "\n";
- return $condition;
-}
-
-sub is {
- my ($got, $expected, $name) = @_;
-
- for ($got, $expected) {
- $_ = 'undef' unless defined $_;
- }
-
- unless (ok($got eq $expected, $name)) {
- warn "Got: '$got'\nExpected: '$expected'\n" . join(' ', caller) . "\n";
- }
-}
-
-sub skip {
- my ($reason, $num) = @_;
- $reason ||= '';
- $number ||= 1;
-
- for (1 .. $num) {
- $number++;
- print "ok $number # skip $reason\n";
- }
-}
-
-1;
-
diff --git a/cpan/libnet/t/netrc.t b/cpan/libnet/t/netrc.t
index e270b368bc..ba0183c1a5 100644
--- a/cpan/libnet/t/netrc.t
+++ b/cpan/libnet/t/netrc.t
@@ -5,17 +5,21 @@ use 5.008001;
use strict;
use warnings;
+use Test::More;
+
BEGIN {
if (!eval { require Socket }) {
- print "1..0 # no Socket\n"; exit 0;
+ plan skip_all => "no Socket";
+ }
+ elsif (ord('A') == 193 && !eval { require Convert::EBCDIC }) {
+ plan skip_all => "EBCDIC but no Convert::EBCDIC";
}
- if (ord('A') == 193 && !eval { require Convert::EBCDIC }) {
- print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0;
+ else {
+ plan tests => 20;
}
}
use Cwd;
-print "1..20\n";
# for testing _readrc
$ENV{HOME} = Cwd::cwd();
@@ -36,9 +40,6 @@ my @stat;
# for testing _readrc
$INC{'FileHandle.pm'} = 1;
-(my $libnet_t = __FILE__) =~ s/\w+.t$/libnet_t.pl/;
-require $libnet_t;
-
# now that the tricks are out of the way...
eval { require Net::Netrc; };
ok( !$@, 'should be able to require() Net::Netrc safely' );
diff --git a/cpan/libnet/t/nntp.t b/cpan/libnet/t/nntp.t
index 559f398554..b346caaf53 100644
--- a/cpan/libnet/t/nntp.t
+++ b/cpan/libnet/t/nntp.t
@@ -7,10 +7,10 @@ use warnings;
BEGIN {
if (!eval { require Socket }) {
- print "1..0 # no Socket\n"; exit 0;
+ print "1..0 # Skip: no Socket\n"; exit 0;
}
if (ord('A') == 193 && !eval { require Convert::EBCDIC }) {
- print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0;
+ print "1..0 # Skip: EBCDIC but no Convert::EBCDIC\n"; exit 0;
}
}
@@ -18,8 +18,13 @@ use Net::Config;
use Net::NNTP;
use Net::Cmd qw(CMD_REJECT);
-unless(@{$NetConfig{nntp_hosts}} && $NetConfig{test_hosts}) {
- print "1..0\n";
+unless(@{$NetConfig{nntp_hosts}}) {
+ print "1..0 # Skip: no nntp_hosts defined in config\n";
+ exit;
+}
+
+unless($NetConfig{test_hosts}) {
+ print "1..0 # Skip: test_hosts not enabled in config\n";
exit;
}
diff --git a/cpan/libnet/t/nntp_ipv6.t b/cpan/libnet/t/nntp_ipv6.t
index 768489a1af..af1ba1631e 100644
--- a/cpan/libnet/t/nntp_ipv6.t
+++ b/cpan/libnet/t/nntp_ipv6.t
@@ -5,10 +5,20 @@ use 5.008001;
use strict;
use warnings;
+use Test::More;
+
+BEGIN {
+ if (!eval { require Socket }) {
+ plan skip_all => "no Socket";
+ }
+ elsif (ord('A') == 193 && !eval { require Convert::EBCDIC }) {
+ plan skip_all => "EBCDIC but no Convert::EBCDIC";
+ }
+}
+
use Config;
use File::Temp 'tempfile';
use Net::NNTP;
-use Test::More;
my $debug = 0; # Net::NNTP->new( Debug => .. )
diff --git a/cpan/libnet/t/nntp_ssl.t b/cpan/libnet/t/nntp_ssl.t
index e6a4fe5f23..5120e9210e 100644
--- a/cpan/libnet/t/nntp_ssl.t
+++ b/cpan/libnet/t/nntp_ssl.t
@@ -5,10 +5,20 @@ use 5.008001;
use strict;
use warnings;
+use Test::More;
+
+BEGIN {
+ if (!eval { require Socket }) {
+ plan skip_all => "no Socket";
+ }
+ elsif (ord('A') == 193 && !eval { require Convert::EBCDIC }) {
+ plan skip_all => "EBCDIC but no Convert::EBCDIC";
+ }
+}
+
use Config;
use File::Temp 'tempfile';
use Net::NNTP;
-use Test::More;
my $debug = 0; # Net::NNTP Debug => ..
diff --git a/cpan/libnet/t/pop3_ipv6.t b/cpan/libnet/t/pop3_ipv6.t
index db311283e0..e68412279c 100644
--- a/cpan/libnet/t/pop3_ipv6.t
+++ b/cpan/libnet/t/pop3_ipv6.t
@@ -5,10 +5,20 @@ use 5.008001;
use strict;
use warnings;
+use Test::More;
+
+BEGIN {
+ if (!eval { require Socket }) {
+ plan skip_all => "no Socket";
+ }
+ elsif (ord('A') == 193 && !eval { require Convert::EBCDIC }) {
+ plan skip_all => "EBCDIC but no Convert::EBCDIC";
+ }
+}
+
use Config;
use File::Temp 'tempfile';
use Net::POP3;
-use Test::More;
my $debug = 0; # Net::POP3->new( Debug => .. )
diff --git a/cpan/libnet/t/pop3_ssl.t b/cpan/libnet/t/pop3_ssl.t
index 356de40acb..12d31ecc58 100644
--- a/cpan/libnet/t/pop3_ssl.t
+++ b/cpan/libnet/t/pop3_ssl.t
@@ -5,10 +5,20 @@ use 5.008001;
use strict;
use warnings;
+use Test::More;
+
+BEGIN {
+ if (!eval { require Socket }) {
+ plan skip_all => "no Socket";
+ }
+ elsif (ord('A') == 193 && !eval { require Convert::EBCDIC }) {
+ plan skip_all => "EBCDIC but no Convert::EBCDIC";
+ }
+}
+
use Config;
use File::Temp 'tempfile';
use Net::POP3;
-use Test::More;
my $debug = 0; # Net::POP3 Debug => ..
diff --git a/cpan/libnet/t/require.t b/cpan/libnet/t/require.t
index 70ec1f67f0..cc14b4bc0d 100644
--- a/cpan/libnet/t/require.t
+++ b/cpan/libnet/t/require.t
@@ -7,10 +7,10 @@ use warnings;
BEGIN {
if (!eval { require Socket }) {
- print "1..0 # no Socket\n"; exit 0;
+ print "1..0 # Skip: no Socket\n"; exit 0;
}
if (ord('A') == 193 && !eval { require Convert::EBCDIC }) {
- print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0;
+ print "1..0 # Skip: EBCDIC but no Convert::EBCDIC\n"; exit 0;
}
}
diff --git a/cpan/libnet/t/smtp.t b/cpan/libnet/t/smtp.t
index 9d6f65a484..e2cd6eb83e 100644
--- a/cpan/libnet/t/smtp.t
+++ b/cpan/libnet/t/smtp.t
@@ -7,18 +7,23 @@ use warnings;
BEGIN {
if (!eval { require Socket }) {
- print "1..0 # no Socket\n"; exit 0;
+ print "1..0 # Skip: no Socket\n"; exit 0;
}
- if (ord('A') == 193 && eval { require Convert::EBCDIC }) {
- print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0;
+ if (ord('A') == 193 && !eval { require Convert::EBCDIC }) {
+ print "1..0 # Skip: EBCDIC but no Convert::EBCDIC\n"; exit 0;
}
}
use Net::Config;
use Net::SMTP;
-unless(@{$NetConfig{smtp_hosts}} && $NetConfig{test_hosts}) {
- print "1..0\n";
+unless(@{$NetConfig{smtp_hosts}}) {
+ print "1..0 # Skip: no smtp_hosts defined in config\n";
+ exit 0;
+}
+
+unless($NetConfig{test_hosts}) {
+ print "1..0 # Skip: test_hosts not enabled in config\n";
exit 0;
}
diff --git a/cpan/libnet/t/smtp_ipv6.t b/cpan/libnet/t/smtp_ipv6.t
index f430721dcc..d0bdb906bb 100644
--- a/cpan/libnet/t/smtp_ipv6.t
+++ b/cpan/libnet/t/smtp_ipv6.t
@@ -5,10 +5,20 @@ use 5.008001;
use strict;
use warnings;
+use Test::More;
+
+BEGIN {
+ if (!eval { require Socket }) {
+ plan skip_all => "no Socket";
+ }
+ elsif (ord('A') == 193 && !eval { require Convert::EBCDIC }) {
+ plan skip_all => "EBCDIC but no Convert::EBCDIC";
+ }
+}
+
use Config;
use File::Temp 'tempfile';
use Net::SMTP;
-use Test::More;
my $debug = 0; # Net::SMTP->new( Debug => .. )
diff --git a/cpan/libnet/t/smtp_ssl.t b/cpan/libnet/t/smtp_ssl.t
index 7290176b23..314dcb708a 100644
--- a/cpan/libnet/t/smtp_ssl.t
+++ b/cpan/libnet/t/smtp_ssl.t
@@ -5,10 +5,20 @@ use 5.008001;
use strict;
use warnings;
+use Test::More;
+
+BEGIN {
+ if (!eval { require Socket }) {
+ plan skip_all => "no Socket";
+ }
+ elsif (ord('A') == 193 && !eval { require Convert::EBCDIC }) {
+ plan skip_all => "EBCDIC but no Convert::EBCDIC";
+ }
+}
+
use Config;
use File::Temp 'tempfile';
use Net::SMTP;
-use Test::More;
my $debug = 0; # Net::SMTP Debug => ..
diff --git a/cpan/libnet/t/time.t b/cpan/libnet/t/time.t
index 6dcba3a3e0..1b02d606cf 100644
--- a/cpan/libnet/t/time.t
+++ b/cpan/libnet/t/time.t
@@ -5,22 +5,24 @@ use 5.008001;
use strict;
use warnings;
+use Test::More;
+
BEGIN {
if (!eval { require Socket }) {
- print "1..0 # no Socket\n"; exit 0;
+ plan skip_all => "no Socket";
+ }
+ elsif (ord('A') == 193 && !eval { require Convert::EBCDIC }) {
+ plan skip_all => "EBCDIC but no Convert::EBCDIC";
}
- if (ord('A') == 193 && !eval { require Convert::EBCDIC }) {
- print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0;
+ else {
+ plan tests => 12;
}
+
$INC{'IO/Socket.pm'} = 1;
$INC{'IO/Select.pm'} = 1;
$INC{'IO/Socket/INET.pm'} = 1;
}
-(my $libnet_t = __FILE__) =~ s/time.t/libnet_t.pl/;
-require $libnet_t;
-
-print "1..12\n";
# cannot use(), otherwise it will use IO::Socket and IO::Select
eval{ require Net::Time; };
ok( !$@, 'should be able to require() Net::Time safely' );