diff --git a/Makefile.PL b/Makefile.PL index f2f73c1..7c128ab 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -84,15 +84,13 @@ WriteMakefile( sub are_online { - return 0 if($ENV{'NO_NETWORK_TESTING'} || $ENV{'TRAVIS_PERL_VERSION'}); - return 0 if(!-t STDIN); + return 0 if($ENV{'NO_NETWORK_TESTING'} || $ENV{'TRAVIS_PERL_VERSION'}) || $ENV{'AUTOMATED_TESTING'} || (!-t STDIN); - my $s = IO::Socket::INET->new( + if(my $s = IO::Socket::INET->new( PeerAddr => 'openstreetmap.org:443', Timeout => 10 - ); - if($s) { - if($ENV{'PERL_MM_USE_DEFAULT'} || $ENV{'AUTOMATED_TESTING'}) { + )) { + if($ENV{'PERL_MM_USE_DEFAULT'}) { close($s); return 0; }