Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed 08a1f60

Fix the imoprts in the module as IO::Socket exports stuff.

  • Participants
  • Parent commits ff3d4ed
  • Tags cpan-releases/2.67

Comments (0)

Files changed (2)

File modules/IO-Socket-INET6/ChangeLog

+2011-01-21 Shlomi Fish <shlomif@iglu.org.il>
+	* IO-Socket is doing some imports so we now do use IO::Socket ().
+		- Fixed the rest of the imports.
+	* Thanks to LeoNerd
+	* New Release IO-Socket-INET6-2.7
+
 2011-01-13 Shlomi Fish <shlomif@iglu.org.il>
 	* Made the use Socket call import constants selectively, and not rely
 	on @EXPORT's whims:

File modules/IO-Socket-INET6/lib/IO/Socket/INET6.pm

 use warnings;
 
 our(@ISA, $VERSION);
-use IO::Socket;
-use Socket (qw(AF_INET6 PF_INET6));
+
+# Do it so we won't import any symbols from IO::Socket which it does export
+# by default:
+# 
+# <LeoNerd> IO::Socket is stupidstupidstupid beyond belief. Despite being an
+# object class, it has an import method
+# <LeoNerd> So you have to use IO::Socket ();
+# <LeoNerd> Having done that, this test is now clean
+use IO::Socket ();
+
+use Socket (qw(
+    AF_INET6 PF_INET6 SOCK_RAW SOCK_STREAM INADDR_ANY SOCK_DGRAM
+    AF_INET SO_REUSEADDR SO_REUSEPORT AF_UNSPEC SO_BROADCAST
+    sockaddr_in
+    )
+);
+
 # IO::Socket and Socket already import stuff here - possibly AF_INET6
 # and PF_INET6 so selectively import things from Socket6.
 use Socket6 (
 use Errno;
 
 @ISA = qw(IO::Socket);
-$VERSION = "2.66";
+$VERSION = "2.67";
 #Purpose: allow protocol independent protocol and original interface.
 
 my $EINVAL = exists(&Errno::EINVAL) ? Errno::EINVAL() : 1;