about summary refs log tree commit
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2014-11-13 18:21:45 +0000
committerSteve Hay <steve.m.hay@googlemail.com>2014-11-13 18:21:45 +0000
commitc2fe21c50ceb473ceb80f1343948d9a172aec59d (patch)
treec29c01cbf45d9da033a9beafdab0f6366dc68c29
parentab4b56a0c627ff9082ef9abe554ca6a68e83ac46 (diff)
downloadperl-libnet-c2fe21c50ceb473ceb80f1343948d9a172aec59d.tar.gz
Avoid "Argument ... isn't numeric in subroutine entry" warnings
Testing IO::Socket::* $VERSIONs can cause "Argument ... isn't numeric in
subroutine entry" warnings on some older perls (e.g. 5.8.8), even when
version.pm is updated to the latest version, if the module in question has
a "development" style version number like "1.79_01".

Fixes one problem reported in CPAN RT#100020.
-rw-r--r--Changes3
-rw-r--r--lib/Net/FTP.pm3
-rw-r--r--lib/Net/NNTP.pm3
-rw-r--r--lib/Net/POP3.pm3
-rw-r--r--lib/Net/SMTP.pm3
5 files changed, 15 insertions, 0 deletions
diff --git a/Changes b/Changes
index c4d78b4..dc7a98c 100644
--- a/Changes
+++ b/Changes
@@ -2,6 +2,9 @@ Revision history for Perl distribution libnet
 
 3.03 Development
 
+    - Fixed "Argument ... isn't numeric in subroutine entry" warnings when using
+      older versions of Perl.  [CPAN RT#100020]
+
     - Added optional Changes testing (skipped unless AUTHOR_TESTING).
 
     - Reformatted Changes file as per CPAN::Changes::Spec.
diff --git a/lib/Net/FTP.pm b/lib/Net/FTP.pm
index b1fd255..8808685 100644
--- a/lib/Net/FTP.pm
+++ b/lib/Net/FTP.pm
@@ -32,6 +32,7 @@ BEGIN {
   my $ssl_class = eval {
     require IO::Socket::SSL;
     # first version with default CA on most platforms
+    no warnings 'numeric';
     IO::Socket::SSL->VERSION(1.999);
   } && 'IO::Socket::SSL';
 
@@ -41,9 +42,11 @@ BEGIN {
   # Code for detecting if we can use IPv6
   my $inet6_class = eval {
     require IO::Socket::IP;
+    no warnings 'numeric';
     IO::Socket::IP->VERSION(0.20);
   } && 'IO::Socket::IP' || eval {
     require IO::Socket::INET6;
+    no warnings 'numeric';
     IO::Socket::INET6->VERSION(2.62);
   } && 'IO::Socket::INET6';
 
diff --git a/lib/Net/NNTP.pm b/lib/Net/NNTP.pm
index f89bc69..60f080f 100644
--- a/lib/Net/NNTP.pm
+++ b/lib/Net/NNTP.pm
@@ -26,6 +26,7 @@ our $VERSION = "3.03";
 my $ssl_class = eval {
   require IO::Socket::SSL;
   # first version with default CA on most platforms
+  no warnings 'numeric';
   IO::Socket::SSL->VERSION(1.999);
 } && 'IO::Socket::SSL';
 
@@ -35,9 +36,11 @@ my $nossl_warn = !$ssl_class &&
 # Code for detecting if we can use IPv6
 my $inet6_class = eval {
   require IO::Socket::IP;
+  no warnings 'numeric';
   IO::Socket::IP->VERSION(0.20);
 } && 'IO::Socket::IP' || eval {
   require IO::Socket::INET6;
+  no warnings 'numeric';
   IO::Socket::INET6->VERSION(2.62);
 } && 'IO::Socket::INET6';
 
diff --git a/lib/Net/POP3.pm b/lib/Net/POP3.pm
index c859428..6109479 100644
--- a/lib/Net/POP3.pm
+++ b/lib/Net/POP3.pm
@@ -25,6 +25,7 @@ our $VERSION = "3.03";
 my $ssl_class = eval {
   require IO::Socket::SSL;
   # first version with default CA on most platforms
+  no warnings 'numeric';
   IO::Socket::SSL->VERSION(1.999);
 } && 'IO::Socket::SSL';
 
@@ -34,9 +35,11 @@ my $nossl_warn = !$ssl_class &&
 # Code for detecting if we can use IPv6
 my $inet6_class = eval {
   require IO::Socket::IP;
+  no warnings 'numeric';
   IO::Socket::IP->VERSION(0.20);
 } && 'IO::Socket::IP' || eval {
   require IO::Socket::INET6;
+  no warnings 'numeric';
   IO::Socket::INET6->VERSION(2.62);
 } && 'IO::Socket::INET6';
 
diff --git a/lib/Net/SMTP.pm b/lib/Net/SMTP.pm
index 4470b3d..1348831 100644
--- a/lib/Net/SMTP.pm
+++ b/lib/Net/SMTP.pm
@@ -26,6 +26,7 @@ our $VERSION = "3.03";
 my $ssl_class = eval {
   require IO::Socket::SSL;
   # first version with default CA on most platforms
+  no warnings 'numeric';
   IO::Socket::SSL->VERSION(1.999);
 } && 'IO::Socket::SSL';
 
@@ -35,9 +36,11 @@ my $nossl_warn = !$ssl_class &&
 # Code for detecting if we can use IPv6
 my $inet6_class = eval {
   require IO::Socket::IP;
+  no warnings 'numeric';
   IO::Socket::IP->VERSION(0.20);
 } && 'IO::Socket::IP' || eval {
   require IO::Socket::INET6;
+  no warnings 'numeric';
   IO::Socket::INET6->VERSION(2.62);
 } && 'IO::Socket::INET6';