Thanks for the patch, I tried it and suggest the following instead
(removing the "_" and everything beyond in the Version string) so that
it actually keeps its behaviour for versions prior to 1.94 and in
addition to that I encountered a third location where $Socket::VERSION
is being used inside that file:

--- Ping.pm.orig        2016-10-27 14:12:58.000000000 +0200
+++ Ping.pm     2019-11-14 13:45:56.886072962 +0100
@@ -1798,7 +1798,9 @@
 
   # address check
   # new way
-  if ($Socket::VERSION >= 1.94) {
+  my $socketVersion = $Socket::VERSION;
+  $socketVersion = $1 if $socketVersion =~ /(\d\.\d+)_\d+/;
+  if ($socketVersion >= 1.94) {
     my %hints = (
       family   => $AF_UNSPEC,
       protocol => IPPROTO_TCP,
@@ -1831,7 +1833,7 @@
 
   # resolve
   # new way
-  if ($Socket::VERSION >= 1.94) {
+  if ($socketVersion >= 1.94) {
     my %hints = (
       family   => $family,
       protocol => IPPROTO_TCP
@@ -1908,7 +1910,9 @@
       ) = @_;
 
   my $ret;
-  if ($Socket::VERSION >= 1.94) {
+  my $socketVersion = $Socket::VERSION;
+  $socketVersion = $1 if $socketVersion =~ /(\d\.\d+)_\d+/;
+  if ($socketVersion >= 1.94) {
     my ($err, $address) = Socket::getnameinfo($addr, $NI_NUMERICHOST);
     if (defined($address)) {
       $ret = $address;

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to perl in Ubuntu.
https://bugs.launchpad.net/bugs/1831423

Title:
  Bogus warning message in Net::Ping in Bionic

Status in perl package in Ubuntu:
  New

Bug description:
  In Ubuntu Bionic's Ping.pm a test of the used socket's version is done
  numerically although the Socket.pm's version contains a special
  character ("_") which causes this warning message:

  Argument "2.020_03" isn't numeric in numeric ge (>=) at
  /usr/share/perl/5.26/Net/Ping.pm line 1801, <DATA> line 755.

  
  Since Socket.pm is part of the same package, the test is not really useful 
anymore. I suggest removing it quick'n dirty via the attached patch to get rid 
of the warning while conserving the "old way".

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/perl/+bug/1831423/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to