From: minima Date: Fri, 11 Jan 2002 01:32:05 +0000 (+0000) Subject: fix it for 5.005 without warnings X-Git-Tag: R_1_50~90 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?p=spider.git;a=commitdiff_plain;h=60bd15a823797c01182ebfb8b6b3a5bf10065b42 fix it for 5.005 without warnings --- diff --git a/perl/Msg.pm b/perl/Msg.pm index 63383cda..5aef961e 100644 --- a/perl/Msg.pm +++ b/perl/Msg.pm @@ -53,13 +53,16 @@ BEGIN { require Errno; Errno->import(qw(EAGAIN EINPROGRESS EWOULDBLOCK)); }; - eval { - require Socket; Socket->import(qw(IPPROTO_TCP TCP_NODELAY)); - }; - if ($@ && !$^O =~ /^MS/) { - dbg("IPPROTO_TCP and TCP_NODELAY manually defined"); - eval '*IPPROTO_TCP = sub { 6 };'; - eval '*TCP_NODELAY = sub { 1 };'; + unless ($^O eq 'MSWin32') { + if ($] >= 5.6) { + eval { + require Socket; Socket->import(qw(IPPROTO_TCP TCP_NODELAY)); + }; + } else { + dbg("IPPROTO_TCP and TCP_NODELAY manually defined"); + eval 'sub IPPROTO_TCP { 6 };'; + eval 'sub TCP_NODELAY { 1 };'; + } } # http://support.microsoft.com/support/kb/articles/Q150/5/37.asp # defines EINPROGRESS as 10035. We provide it here because some