Skip Menu |

This queue is for tickets about the IO-Socket-IP CPAN distribution.

Report information
The Basics
Id: 133322
Status: resolved
Priority: 0/
Queue: IO-Socket-IP

People
Owner: Nobody in particular
Requestors: TODDR [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.39
Fixed in: 0.41



Subject: IO::Socket::IP is not strict.
$VERSION is not declared outside the BEGIN block with an our. I suggest: diff --git a/cpan/IO-Socket-IP/lib/IO/Socket/IP.pm b/cpan/IO-Socket-IP/lib/IO/Socket/IP.pm index 5a5ee7d204..10e63d1365 100644 --- a/cpan/IO-Socket-IP/lib/IO/Socket/IP.pm +++ b/cpan/IO-Socket-IP/lib/IO/Socket/IP.pm @@ -6,6 +6,7 @@ package IO::Socket::IP; # $VERSION needs to be set before use base 'IO::Socket' # - https://rt.cpan.org/Ticket/Display.html?id=92107 +our $VERSION; BEGIN { $VERSION = '0.39'; }
Slightly nicer is to contain the `our` inside the BEGIN block so it doesn't lexically leak. Also, moved the `use strict+warnings` to the top to catch it or similar in future. -- Paul Evans
Subject: rt133322.patch
=== modified file 'lib/IO/Socket/IP.pm' --- old/lib/IO/Socket/IP.pm 2017-06-20 15:08:50 +0000 +++ new/lib/IO/Socket/IP.pm 2020-09-15 15:35:19 +0000 @@ -4,14 +4,16 @@ # (C) Paul Evans, 2010-2015 -- leonerd@leonerd.org.uk package IO::Socket::IP; + +use strict; +use warnings; + # $VERSION needs to be set before use base 'IO::Socket' # - https://rt.cpan.org/Ticket/Display.html?id=92107 BEGIN { - $VERSION = '0.39'; + our $VERSION = '0.39'; } -use strict; -use warnings; use base qw( IO::Socket ); use Carp;
Fixed in 0.40 / 0.41 -- Paul Evans