diff options
author | Steve Hay <steve.m.hay@googlemail.com> | 2014-05-31 12:43:56 +0100 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2014-05-31 15:57:04 +0100 |
commit | 5abafd4c71e6974545540e9ae07b6b72cdb3fd35 (patch) | |
tree | 7675019af4c8c9610e8a2c40bcf9e7f75d70abeb /cpan/libnet | |
parent | 1524a56aaa5d246d02ca951a4de771af3d9c2a54 (diff) | |
download | perl-5abafd4c71e6974545540e9ae07b6b72cdb3fd35.tar.gz |
Upgrade libnet from version 1.25 to 1.27
This eliminates the need to have a CUSTOMIZED Makefile.PL. The other changes
(to modules and test scripts) are whitespace only.
Diffstat (limited to 'cpan/libnet')
-rw-r--r-- | cpan/libnet/Config.eg | 62 | ||||
-rw-r--r-- | cpan/libnet/Makefile.PL | 159 | ||||
-rw-r--r-- | cpan/libnet/Net/Config.pm | 8 | ||||
-rw-r--r-- | cpan/libnet/Net/SMTP.pm | 22 | ||||
-rw-r--r-- | cpan/libnet/Net/Time.pm | 6 | ||||
-rw-r--r-- | cpan/libnet/t/config.t | 44 | ||||
-rw-r--r-- | cpan/libnet/t/datasend.t | 6 | ||||
-rw-r--r-- | cpan/libnet/t/ftp.t | 8 | ||||
-rw-r--r-- | cpan/libnet/t/hostname.t | 6 | ||||
-rw-r--r-- | cpan/libnet/t/libnet_t.pl | 42 | ||||
-rw-r--r-- | cpan/libnet/t/netrc.t | 100 | ||||
-rw-r--r-- | cpan/libnet/t/nntp.t | 8 | ||||
-rw-r--r-- | cpan/libnet/t/require.t | 6 | ||||
-rw-r--r-- | cpan/libnet/t/smtp.t | 8 | ||||
-rw-r--r-- | cpan/libnet/t/time.t | 82 |
15 files changed, 354 insertions, 213 deletions
diff --git a/cpan/libnet/Config.eg b/cpan/libnet/Config.eg index 77dc1f138b..820231537d 100644 --- a/cpan/libnet/Config.eg +++ b/cpan/libnet/Config.eg @@ -13,37 +13,37 @@ use strict; # Below this line is auto-generated, *ANY* changes will be lost %NetConfig = ( - # the followinf parameters are all lists of hosts for the - # respective protocols. - nntp_hosts => [], - snpp_hosts => [], - pop3_hosts => [], - smtp_hosts => [], - ph_hosts => [], - daytime_hosts => [], - time_hosts => [], - - # your internet domain - inet_domain => undef, - - # If you have an ftp proxy firewall (not an http firewall) - # then set this to the name of the firewall - ftp_firewall => undef, - - # set if all connections done via the firewall should use - # passive data connections - ftp_ext_passive => 0, - - # set if all connections not done via the firewall should use - # passive data connections - ftp_int_passive => 0, - - # If set the make test will attempt to connect to the hosts above - test_hosts => 0, - - # Used during Configure (which you are not using) to do - # DNS lookups to ensure hosts exist - test_exist => 0, + # the followinf parameters are all lists of hosts for the + # respective protocols. + nntp_hosts => [], + snpp_hosts => [], + pop3_hosts => [], + smtp_hosts => [], + ph_hosts => [], + daytime_hosts => [], + time_hosts => [], + + # your internet domain + inet_domain => undef, + + # If you have an ftp proxy firewall (not an http firewall) + # then set this to the name of the firewall + ftp_firewall => undef, + + # set if all connections done via the firewall should use + # passive data connections + ftp_ext_passive => 0, + + # set if all connections not done via the firewall should use + # passive data connections + ftp_int_passive => 0, + + # If set the make test will attempt to connect to the hosts above + test_hosts => 0, + + # Used during Configure (which you are not using) to do + # DNS lookups to ensure hosts exist + test_exist => 0, ); 1; diff --git a/cpan/libnet/Makefile.PL b/cpan/libnet/Makefile.PL index 6f904c221e..7e21e3c61c 100644 --- a/cpan/libnet/Makefile.PL +++ b/cpan/libnet/Makefile.PL @@ -1,10 +1,151 @@ +#!perl +#=============================================================================== +# +# Makefile.PL +# +# DESCRIPTION +# Makefile creation script. +# +# COPYRIGHT +# Copyright (C) 2014 Steve Hay. All rights reserved. +# +# LICENCE +# You may distribute under the terms of either the GNU General Public License +# or the Artistic License, as specified in the LICENCE file. +# +#=============================================================================== + +use 5.008001; + use strict; -use ExtUtils::MakeMaker; - -WriteMakefile ( - NAME => 'Net', - DISTNAME => 'libnet', - VERSION => '1.25', # finds $VERSION - AUTHOR => 'Graham Barr <gbarr@pobox.com>', - ABSTRACT => 'Collection of Network protocol modules', -); +use warnings; + +use ExtUtils::MakeMaker 6.64; +use ExtUtils::MakeMaker qw(WriteMakefile); + +#=============================================================================== +# INITIALIZATION +#=============================================================================== + +our($CfgFile, $CfgPath); + +BEGIN { + $CfgFile = 'libnet.cfg'; + $CfgPath = "Net/$CfgFile"; +} + +#=============================================================================== +# MAIN PROGRAM +#=============================================================================== + +MAIN: { + my %prereq_pms = (); + $prereq_pms{'Convert::EBCDIC'} = '0.06' if $^O eq 'os390'; + + WriteMakefile( + NAME => 'Net', + DISTNAME => 'libnet', + ABSTRACT => 'Collection of network protocol modules', + AUTHOR => 'Graham Barr <gbarr@pobox.com>, Steve Hay <shay@cpan.org>', + LICENSE => 'perl_5', + VERSION => '1.27', + + META_MERGE => { + 'meta-spec' => { + version => 2 + }, + + resources => { + repository => { + type => 'git', + url => 'https://github.com/steve-m-hay/perl-libnet.git' + } + }, + + optional_features => { + APOP => { + description => 'APOP support', + prereqs => { + runtime => { + requires => { + 'Digest::MD5' => '0' + } + } + } + }, + + AUTH => { + description => 'AUTH support', + prereqs => { + runtime => { + requires => { + 'Authen::SASL' => '0', + 'MIME::Base64' => '0' + } + } + } + } + } + }, + + MIN_PERL_VERSION => '5.008001', + + CONFIGURE_REQUIRES => { + 'ExtUtils::MakeMaker' => '6.64', + 'Getopt::Std' => '0', + 'IO:File' => '0', + 'perl' => '5.008001', + 'strict' => '0', + 'vars' => '0', + 'warnings' => '0' + }, + + TEST_REQUIRES => { + 'Cwd' => '0' + }, + + PREREQ_PM => { + %prereq_pms, + 'Carp' => '0', + 'Errno' => '0', + 'Exporter' => '0', + 'Fcntl' => '0', + 'File::Basename' => '0', + 'FileHandle' => '0', + 'IO::Select' => '0', + 'IO::Socket' => '1.05', + 'POSIX' => '0', + 'Socket' => '1.3', + 'Symbol' => '0', + 'Time::Local' => '0', + 'strict' => '0', + 'vars' => '0' + }, + + INSTALLDIRS => 'perl', + + realclean => { + FILES => $CfgFile + }, + + dist => { + PREOP => 'find $(DISTVNAME) -type d -print|xargs chmod 0755 && ' . + 'find $(DISTVNAME) -type f -print|xargs chmod 0644', + TO_UNIX => 'find $(DISTVNAME) -type f -print|xargs dos2unix' + } + ); +} + +#=============================================================================== +# MAKEMAKER OVERRIDES +#=============================================================================== + +sub MY::post_initialize { + my $self = shift; + return '' if $self->{PERL_CORE}; + system(($^O eq 'VMS' ? 'mcr ': ()), $^X, 'Configure') unless -f $CfgFile; + $self->{PM}{$CfgFile} = $self->catfile('$(INST_LIBDIR)',$CfgPath); + return ''; +} + +#=============================================================================== diff --git a/cpan/libnet/Net/Config.pm b/cpan/libnet/Net/Config.pm index ba16332180..f9d04e1343 100644 --- a/cpan/libnet/Net/Config.pm +++ b/cpan/libnet/Net/Config.pm @@ -13,7 +13,7 @@ use strict; @EXPORT = qw(%NetConfig); @ISA = qw(Net::LocalCfg Exporter); -$VERSION = "1.13"; +$VERSION = "1.14"; eval { local $SIG{__DIE__}; require Net::LocalCfg }; @@ -49,9 +49,9 @@ my %nc = ( ftp_ext_passive => \$InternetConfig{"646F676F\xA5UsePassiveMode"} || 0, ftp_int_passive => \$InternetConfig{"646F676F\xA5UsePassiveMode"} || 0, socks_hosts => - \$InternetConfig{ kICUseSocks() } ? [ \$InternetConfig{ kICSocksHost() } ] : [], + \$InternetConfig{ kICUseSocks() } ? [ \$InternetConfig{ kICSocksHost() } ] : [], ftp_firewall => - \$InternetConfig{ kICUseFTPProxy() } ? [ \$InternetConfig{ kICFTPProxyHost() } ] : [], + \$InternetConfig{ kICUseFTPProxy() } ? [ \$InternetConfig{ kICFTPProxyHost() } ] : [], ); \@NetConfig{keys %nc} = values %nc; } @@ -141,7 +141,7 @@ For example # .libnetrc { nntp_hosts => [ "my_preferred_host" ], - ph_hosts => [ "my_ph_server" ], + ph_hosts => [ "my_ph_server" ], } __END__ diff --git a/cpan/libnet/Net/SMTP.pm b/cpan/libnet/Net/SMTP.pm index 705b5c5ab5..3d193a44d7 100644 --- a/cpan/libnet/Net/SMTP.pm +++ b/cpan/libnet/Net/SMTP.pm @@ -16,7 +16,7 @@ use IO::Socket; use Net::Cmd; use Net::Config; -$VERSION = "2.33"; +$VERSION = "2.34"; @ISA = qw(Net::Cmd IO::Socket::INET); @@ -642,24 +642,24 @@ Example: $smtp = Net::SMTP->new('mailhost', - Hello => 'my.mail.domain', - Timeout => 30, + Hello => 'my.mail.domain', + Timeout => 30, Debug => 1, - ); + ); # the same $smtp = Net::SMTP->new( - Host => 'mailhost', - Hello => 'my.mail.domain', - Timeout => 30, + Host => 'mailhost', + Hello => 'my.mail.domain', + Timeout => 30, Debug => 1, - ); + ); # Connect to the default server from Net::config $smtp = Net::SMTP->new( - Hello => 'my.mail.domain', - Timeout => 30, - ); + Hello => 'my.mail.domain', + Timeout => 30, + ); =back diff --git a/cpan/libnet/Net/Time.pm b/cpan/libnet/Net/Time.pm index 6f1dd04586..6b3b641643 100644 --- a/cpan/libnet/Net/Time.pm +++ b/cpan/libnet/Net/Time.pm @@ -17,7 +17,7 @@ use IO::Select; @ISA = qw(Exporter); @EXPORT_OK = qw(inet_time inet_daytime); -$VERSION = "2.10"; +$VERSION = "2.11"; $TIMEOUT = 120; @@ -107,11 +107,11 @@ Net::Time - time and daytime network client interface use Net::Time qw(inet_time inet_daytime); - print inet_time(); # use default host from Net::Config + print inet_time(); # use default host from Net::Config print inet_time('localhost'); print inet_time('localhost', 'tcp'); - print inet_daytime(); # use default host from Net::Config + print inet_daytime(); # use default host from Net::Config print inet_daytime('localhost'); print inet_daytime('localhost', 'tcp'); diff --git a/cpan/libnet/t/config.t b/cpan/libnet/t/config.t index 08df82b1ee..3a3425123f 100644 --- a/cpan/libnet/t/config.t +++ b/cpan/libnet/t/config.t @@ -2,11 +2,11 @@ BEGIN { if ($ENV{PERL_CORE}) { - chdir 't' if -d 't'; - @INC = '../lib'; + chdir 't' if -d 't'; + @INC = '../lib'; } if (!eval "require Socket") { - print "1..0 # no Socket\n"; exit 0; + print "1..0 # no Socket\n"; exit 0; } undef *{Socket::inet_aton}; undef *{Socket::inet_ntoa}; @@ -19,29 +19,29 @@ BEGIN { package Socket; sub import { - my $pkg = caller(); - no strict 'refs'; - *{ $pkg . '::inet_aton' } = \&inet_aton; - *{ $pkg . '::inet_ntoa' } = \&inet_ntoa; + my $pkg = caller(); + no strict 'refs'; + *{ $pkg . '::inet_aton' } = \&inet_aton; + *{ $pkg . '::inet_ntoa' } = \&inet_ntoa; } my $fail = 0; my %names; sub set_fail { - $fail = shift; + $fail = shift; } sub inet_aton { - return if $fail; - my $num = unpack('N', pack('C*', split(/\./, $_[0]))); - $names{$num} = $_[0]; - return $num; + return if $fail; + my $num = unpack('N', pack('C*', split(/\./, $_[0]))); + $names{$num} = $_[0]; + return $num; } sub inet_ntoa { - return if $fail; - return $names{$_[0]}; + return if $fail; + return $names{$_[0]}; } package main; @@ -59,29 +59,29 @@ ok( keys %NetConfig, '%NetConfig should be imported' ); Socket::set_fail(1); undef $NetConfig{'ftp_firewall'}; is( Net::Config->requires_firewall(), 0, - 'requires_firewall() should return 0 without ftp_firewall defined' ); + 'requires_firewall() should return 0 without ftp_firewall defined' ); $NetConfig{'ftp_firewall'} = 1; is( Net::Config->requires_firewall('a.host.not.there'), -1, - '... should return -1 without a valid hostname' ); + '... should return -1 without a valid hostname' ); Socket::set_fail(0); delete $NetConfig{'local_netmask'}; is( Net::Config->requires_firewall('127.0.0.1'), 0, - '... should return 0 without local_netmask defined' ); + '... should return 0 without local_netmask defined' ); $NetConfig{'local_netmask'} = '127.0.0.1/24'; is( Net::Config->requires_firewall('127.0.0.1'), 0, - '... should return false if host is within netmask' ); + '... should return false if host is within netmask' ); is( Net::Config->requires_firewall('192.168.10.0'), 1, - '... should return true if host is outside netmask' ); + '... should return true if host is outside netmask' ); # now try more netmasks $NetConfig{'local_netmask'} = [ '127.0.0.1/24', '10.0.0.0/8' ]; is( Net::Config->requires_firewall('10.10.255.254'), 0, - '... should find success with mutiple local netmasks' ); + '... should find success with mutiple local netmasks' ); is( Net::Config->requires_firewall('192.168.10.0'), 1, - '... should handle failure with multiple local netmasks' ); + '... should handle failure with multiple local netmasks' ); is( \&Net::Config::is_external, \&Net::Config::requires_firewall, - 'is_external() should be an alias for requires_firewall()' ); + 'is_external() should be an alias for requires_firewall()' ); diff --git a/cpan/libnet/t/datasend.t b/cpan/libnet/t/datasend.t index 96b5b7c619..f642340757 100644 --- a/cpan/libnet/t/datasend.t +++ b/cpan/libnet/t/datasend.t @@ -2,11 +2,11 @@ BEGIN { if ($ENV{PERL_CORE}) { - chdir 't' if -d 't'; - @INC = '../lib'; + chdir 't' if -d 't'; + @INC = '../lib'; } if (!eval "require Socket") { - print "1..0 # no Socket\n"; exit 0; + print "1..0 # no Socket\n"; exit 0; } if (ord('A') == 193 && !eval "require Convert::EBCDIC") { print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0; diff --git a/cpan/libnet/t/ftp.t b/cpan/libnet/t/ftp.t index dc690b6c17..0c1b0e338c 100644 --- a/cpan/libnet/t/ftp.t +++ b/cpan/libnet/t/ftp.t @@ -2,11 +2,11 @@ BEGIN { unless (-d 'blib') { - chdir 't' if -d 't'; - @INC = '../lib'; + chdir 't' if -d 't'; + @INC = '../lib'; } if (!eval "require Socket") { - print "1..0 # Skip: no Socket module\n"; exit 0; + print "1..0 # Skip: no Socket module\n"; exit 0; } if (ord('A') == 193 && !eval "require Convert::EBCDIC") { print "1..0 # Skip: EBCDIC but no Convert::EBCDIC\n"; exit 0; @@ -30,7 +30,7 @@ my $t = 1; print "1..7\n"; $ftp = Net::FTP->new($NetConfig{ftp_testhost}) - or (print("not ok 1\n"), exit); + or (print("not ok 1\n"), exit); printf "ok %d\n",$t++; diff --git a/cpan/libnet/t/hostname.t b/cpan/libnet/t/hostname.t index 4013d74aab..f486bb4702 100644 --- a/cpan/libnet/t/hostname.t +++ b/cpan/libnet/t/hostname.t @@ -2,11 +2,11 @@ BEGIN { unless (-d 'blib') { - chdir 't' if -d 't'; - @INC = '../lib'; + chdir 't' if -d 't'; + @INC = '../lib'; } if (!eval "require Socket") { - print "1..0 # no Socket\n"; exit 0; + print "1..0 # no Socket\n"; exit 0; } if (ord('A') == 193 && !eval "require Convert::EBCDIC") { print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0; diff --git a/cpan/libnet/t/libnet_t.pl b/cpan/libnet/t/libnet_t.pl index ed245e6502..9337dd1dc7 100644 --- a/cpan/libnet/t/libnet_t.pl +++ b/cpan/libnet/t/libnet_t.pl @@ -1,36 +1,36 @@ my $number = 0; sub ok { - my ($condition, $name) = @_; + my ($condition, $name) = @_; - my $message = $condition ? "ok " : "not ok "; - $message .= ++$number; - $message .= " # $name" if defined $name; - print $message, "\n"; - return $condition; + my $message = $condition ? "ok " : "not ok "; + $message .= ++$number; + $message .= " # $name" if defined $name; + print $message, "\n"; + return $condition; } sub is { - my ($got, $expected, $name) = @_; + my ($got, $expected, $name) = @_; - for ($got, $expected) { - $_ = 'undef' unless defined $_; - } + for ($got, $expected) { + $_ = 'undef' unless defined $_; + } - unless (ok($got eq $expected, $name)) { - warn "Got: '$got'\nExpected: '$expected'\n" . join(' ', caller) . "\n"; - } + unless (ok($got eq $expected, $name)) { + warn "Got: '$got'\nExpected: '$expected'\n" . join(' ', caller) . "\n"; + } } sub skip { - my ($reason, $num) = @_; - $reason ||= ''; - $number ||= 1; - - for (1 .. $num) { - $number++; - print "ok $number # skip $reason\n"; - } + my ($reason, $num) = @_; + $reason ||= ''; + $number ||= 1; + + for (1 .. $num) { + $number++; + print "ok $number # skip $reason\n"; + } } 1; diff --git a/cpan/libnet/t/netrc.t b/cpan/libnet/t/netrc.t index 2a0095604b..bb97244f7c 100644 --- a/cpan/libnet/t/netrc.t +++ b/cpan/libnet/t/netrc.t @@ -2,11 +2,11 @@ BEGIN { if ($ENV{PERL_CORE}) { - chdir 't' if -d 't'; - @INC = '../lib'; + chdir 't' if -d 't'; + @INC = '../lib'; } if (!eval "require Socket") { - print "1..0 # no Socket\n"; exit 0; + print "1..0 # no Socket\n"; exit 0; } if (ord('A') == 193 && !eval "require Convert::EBCDIC") { print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0; @@ -25,13 +25,13 @@ $ENV{HOME} = Cwd::cwd(); local (*CORE::GLOBAL::getpwuid, *CORE::GLOBAL::stat); *CORE::GLOBAL::getpwuid = sub ($) { - ((undef) x 7, Cwd::cwd()); + ((undef) x 7, Cwd::cwd()); }; # for testing _readrc my @stat; *CORE::GLOBAL::stat = sub (*) { - return @stat; + return @stat; }; # for testing _readrc @@ -47,29 +47,29 @@ ok( exists $INC{'Net/Netrc.pm'}, 'should be able to use Net::Netrc' ); $Net::Netrc::TESTING=$Net::Netrc::TESTING=1; SKIP: { - skip('incompatible stat() handling for OS', 4), next SKIP - if ($^O =~ /os2|win32|macos|cygwin/i or $] < 5.005); - - my $warn; - local $SIG{__WARN__} = sub { - $warn = shift; - }; - - # add write access for group/other - $stat[2] = 077; - ok( !defined(Net::Netrc::_readrc()), - '_readrc() should not read world-writable file' ); - ok( scalar($warn =~ /^Bad permissions:/), - '... and should warn about it' ); - - # the owner field should still not match - $stat[2] = 0; + skip('incompatible stat() handling for OS', 4), next SKIP + if ($^O =~ /os2|win32|macos|cygwin/i or $] < 5.005); + + my $warn; + local $SIG{__WARN__} = sub { + $warn = shift; + }; + + # add write access for group/other + $stat[2] = 077; + ok( !defined(Net::Netrc::_readrc()), + '_readrc() should not read world-writable file' ); + ok( scalar($warn =~ /^Bad permissions:/), + '... and should warn about it' ); + + # the owner field should still not match + $stat[2] = 0; if ($<) { ok( !defined(Net::Netrc::_readrc()), '_readrc() should not read file owned by someone else' ); ok( scalar($warn =~ /^Not owner:/), - '... and should warn about it' ); + '... and should warn about it' ); } else { skip("testing as root",2); } @@ -80,15 +80,15 @@ $stat[4] = $<; # this curious mix of spaces and quotes tests a regex at line 79 (version 2.11) FileHandle::set_lines(split(/\n/, <<LINES)); -macdef bar -login baz - machine "foo" -login nigol "password" drowssap -machine foo "login" l2 - password p2 -account tnuocca -default login "baz" password p2 -default "login" baz password p3 +macdef bar +login baz +machine "foo" +login nigol "password" drowssap +machine foo "login" l2 +password p2 +account tnuocca +default login "baz" password p2 +default "login" baz password p3 macdef LINES @@ -97,59 +97,59 @@ is( Net::Netrc::_readrc(), 1, '_readrc() should succeed now' ); # on 'foo', the login is 'nigol' is( Net::Netrc->lookup('foo')->{login}, 'nigol', - 'lookup() should find value by host name' ); + 'lookup() should find value by host name' ); # on 'foo' with login 'l2', the password is 'p2' is( Net::Netrc->lookup('foo', 'l2')->{password}, 'p2', - 'lookup() should find value by hostname and login name' ); + 'lookup() should find value by hostname and login name' ); # the default password is 'p3', as later declarations have priority is( Net::Netrc->lookup()->{password}, 'p3', - 'lookup() should find default value' ); + 'lookup() should find default value' ); # lookup() ignores the login parameter when using default data is( Net::Netrc->lookup('default', 'baz')->{password}, 'p3', - 'lookup() should ignore passed login when searching default' ); + 'lookup() should ignore passed login when searching default' ); # lookup() goes to default data if hostname cannot be found in config data is( Net::Netrc->lookup('abadname')->{login}, 'baz', - 'lookup() should use default for unknown machine name' ); + 'lookup() should use default for unknown machine name' ); # now test these accessors my $instance = bless({}, 'Net::Netrc'); for my $accessor (qw( login account password )) { - is( $instance->$accessor(), undef, - "$accessor() should return undef if $accessor is not set" ); - $instance->{$accessor} = $accessor; - is( $instance->$accessor(), $accessor, - "$accessor() should return value when $accessor is set" ); + is( $instance->$accessor(), undef, + "$accessor() should return undef if $accessor is not set" ); + $instance->{$accessor} = $accessor; + is( $instance->$accessor(), $accessor, + "$accessor() should return value when $accessor is set" ); } # and the three-for-one accessor is( scalar( () = $instance->lpa()), 3, - 'lpa() should return login, password, account'); + 'lpa() should return login, password, account'); is( join(' ', $instance->lpa), 'login password account', - 'lpa() should return appropriate values for l, p, and a' ); + 'lpa() should return appropriate values for l, p, and a' ); package FileHandle; sub new { - tie *FH, 'FileHandle', @_; - bless \*FH, $_[0]; + tie *FH, 'FileHandle', @_; + bless \*FH, $_[0]; } sub TIEHANDLE { - my ($class, $file, $mode) = @_[0,2,3]; - bless({ file => $file, mode => $mode }, $class); + my ($class, $file, $mode) = @_[0,2,3]; + bless({ file => $file, mode => $mode }, $class); } my @lines; sub set_lines { - @lines = @_; + @lines = @_; } sub READLINE { - shift @lines; + shift @lines; } sub close { 1 } diff --git a/cpan/libnet/t/nntp.t b/cpan/libnet/t/nntp.t index 7fb99de62c..643cfc8bc5 100644 --- a/cpan/libnet/t/nntp.t +++ b/cpan/libnet/t/nntp.t @@ -2,11 +2,11 @@ BEGIN { unless (-d 'blib') { - chdir 't' if -d 't'; - @INC = '../lib'; + chdir 't' if -d 't'; + @INC = '../lib'; } if (!eval "require Socket") { - print "1..0 # no Socket\n"; exit 0; + print "1..0 # no Socket\n"; exit 0; } if (ord('A') == 193 && !eval "require Convert::EBCDIC") { print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0; @@ -27,7 +27,7 @@ print "1..4\n"; my $i = 1; $nntp = Net::NNTP->new(Debug => 0) - or (print("not ok 1\n"), exit); + or (print("not ok 1\n"), exit); print "ok 1\n"; diff --git a/cpan/libnet/t/require.t b/cpan/libnet/t/require.t index 163c8bd801..973ed41d7c 100644 --- a/cpan/libnet/t/require.t +++ b/cpan/libnet/t/require.t @@ -2,11 +2,11 @@ BEGIN { unless (-d 'blib') { - chdir 't' if -d 't'; - @INC = '../lib'; + chdir 't' if -d 't'; + @INC = '../lib'; } if (!eval "require Socket") { - print "1..0 # no Socket\n"; exit 0; + print "1..0 # no Socket\n"; exit 0; } if (ord('A') == 193 && !eval "require Convert::EBCDIC") { print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0; diff --git a/cpan/libnet/t/smtp.t b/cpan/libnet/t/smtp.t index ac2df6c8b9..6daef3123c 100644 --- a/cpan/libnet/t/smtp.t +++ b/cpan/libnet/t/smtp.t @@ -2,11 +2,11 @@ BEGIN { unless (-d 'blib') { - chdir 't' if -d 't'; - @INC = '../lib'; + chdir 't' if -d 't'; + @INC = '../lib'; } if (!eval "require Socket") { - print "1..0 # no Socket\n"; exit 0; + print "1..0 # no Socket\n"; exit 0; } if (ord('A') == 193 && !eval "require Convert::EBCDIC") { print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0; @@ -26,7 +26,7 @@ print "1..3\n"; my $i = 1; $smtp = Net::SMTP->new(Debug => 0) - or (print("not ok 1\n"), exit); + or (print("not ok 1\n"), exit); print "ok 1\n"; diff --git a/cpan/libnet/t/time.t b/cpan/libnet/t/time.t index a8d416eea2..224b640ced 100644 --- a/cpan/libnet/t/time.t +++ b/cpan/libnet/t/time.t @@ -2,14 +2,14 @@ BEGIN { if ($ENV{PERL_CORE}) { - chdir 't' if -d 't'; - @INC = '../lib'; + chdir 't' if -d 't'; + @INC = '../lib'; } if (!eval "require Socket") { - print "1..0 # no Socket\n"; exit 0; + print "1..0 # no Socket\n"; exit 0; } if (ord('A') == 193 && !eval "require Convert::EBCDIC") { - print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0; + print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0; } $INC{'IO/Socket.pm'} = 1; $INC{'IO/Select.pm'} = 1; @@ -50,84 +50,84 @@ is( Net::Time::inet_daytime('bob'), 'z', 'inet_daytime() should receive data' ); # magic numbers defined in Net::Time my $offset = $^O eq 'MacOS' ? - (4 * 31536000) : (70 * 31536000 + 17 * 86400); + (4 * 31536000) : (70 * 31536000 + 17 * 86400); # check for correct args (time, 13) # pretend it is only six seconds since the offset, create a fake message # inet_time IO::Socket::INET::set_message(pack("N", $offset + 6)); is( Net::Time::inet_time('foo'), 6, - 'inet_time() should calculate time since offset for time()' ); + 'inet_time() should calculate time since offset for time()' ); my %fail; sub make_fail { - my ($pack, $func, $num) = @_; - $num = 1 unless defined $num; + my ($pack, $func, $num) = @_; + $num = 1 unless defined $num; - $fail{$pack}{$func} = $num; + $fail{$pack}{$func} = $num; } package IO::Socket::INET; $fail{'IO::Socket::INET'} = { - new => 0, - 'send' => 0, + new => 0, + 'send' => 0, }; sub new { - my $class = shift; - return if $fail{$class}{new} and $fail{$class}{new}--; - bless( { @_ }, $class ); + my $class = shift; + return if $fail{$class}{new} and $fail{$class}{new}--; + bless( { @_ }, $class ); } sub send { - my $self = shift; - my $class = ref($self); - return if $fail{$class}{'send'} and $fail{$class}{'send'}--; - $self->{sent} .= shift; + my $self = shift; + my $class = ref($self); + return if $fail{$class}{'send'} and $fail{$class}{'send'}--; + $self->{sent} .= shift; } my $msg; sub set_message { - if (ref($_[0])) { - $_[0]->{msg} = $_[1]; - } else { - $msg = shift; - } + if (ref($_[0])) { + $_[0]->{msg} = $_[1]; + } else { + $msg = shift; + } } sub do_recv { - my ($len, $msg) = @_[1,2]; - $_[0] .= substr($msg, 0, $len); + my ($len, $msg) = @_[1,2]; + $_[0] .= substr($msg, 0, $len); } sub recv { - my ($self, $buf, $length, $flags) = @_; - my $message = exists $self->{msg} ? - $self->{msg} : $msg; - - if (defined($message)) { - do_recv($_[1], $length, $message); - } - 1; + my ($self, $buf, $length, $flags) = @_; + my $message = exists $self->{msg} ? + $self->{msg} : $msg; + + if (defined($message)) { + do_recv($_[1], $length, $message); + } + 1; } package IO::Select; sub new { - my $class = shift; - return if defined $fail{$class}{new} and $fail{$class}{new}--; - bless({sock => shift}, $class); + my $class = shift; + return if defined $fail{$class}{new} and $fail{$class}{new}--; + bless({sock => shift}, $class); } sub can_read { - my ($self, $timeout) = @_; - my $class = ref($self); - return if defined $fail{$class}{can_read} and $fail{class}{can_read}--; - $self->{sock}{timeout} = $timeout; - 1; + my ($self, $timeout) = @_; + my $class = ref($self); + return if defined $fail{$class}{can_read} and $fail{class}{can_read}--; + $self->{sock}{timeout} = $timeout; + 1; } 1; |