r63689 - in /branches/upstream/libnetaddr-ip-perl/current: Changes IP.pm Lite/Changes Lite/Lite.pm Lite/README Lite/Util/Changes Lite/Util/README Lite/Util/Util.pm Lite/t/over_equal.t META.yml
periapt-guest at users.alioth.debian.org
periapt-guest at users.alioth.debian.org
Thu Oct 14 06:54:05 UTC 2010
Author: periapt-guest
Date: Thu Oct 14 06:53:49 2010
New Revision: 63689
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=63689
Log:
[svn-upgrade] new version libnetaddr-ip-perl (4.033+dfsg)
Modified:
branches/upstream/libnetaddr-ip-perl/current/Changes
branches/upstream/libnetaddr-ip-perl/current/IP.pm
branches/upstream/libnetaddr-ip-perl/current/Lite/Changes
branches/upstream/libnetaddr-ip-perl/current/Lite/Lite.pm
branches/upstream/libnetaddr-ip-perl/current/Lite/README
branches/upstream/libnetaddr-ip-perl/current/Lite/Util/Changes
branches/upstream/libnetaddr-ip-perl/current/Lite/Util/README
branches/upstream/libnetaddr-ip-perl/current/Lite/Util/Util.pm
branches/upstream/libnetaddr-ip-perl/current/Lite/t/over_equal.t
branches/upstream/libnetaddr-ip-perl/current/META.yml
Modified: branches/upstream/libnetaddr-ip-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnetaddr-ip-perl/current/Changes?rev=63689&op=diff
==============================================================================
--- branches/upstream/libnetaddr-ip-perl/current/Changes (original)
+++ branches/upstream/libnetaddr-ip-perl/current/Changes Thu Oct 14 06:53:49 2010
@@ -1,4 +1,29 @@
Revision history for Perl extension NetAddr::IP
+
+4.033 Wed Sep 29 10:32:50 PDT 2010
+ Conditionalize import of AF_INET6 in Util.pm
+ NetAddr::IP::UtilPolluted
+
+4.032 Wed Sep 22 13:39:08 PDT 2010
+ Added overload => 'ne' and '!=' to Lite.pm v1.18
+
+4.031 Tue Sep 21 19:21:04 PDT 2010
+ Pull Socket6 stuff out of Lite 1.17 and put into
+ NetAddr::IP::Util.pm 1.33 in its own namespace
+
+4.030 Tue Jul 20 15:32:23 PDT 2010
+ Resolve named hosts in Lite.pm using gethostbyname, followed by
+ gethostbyname6 to determine whether to set ipV6 flag
+
+ Thanks to Dusty Mabe <Dusty.Mabe at tekelec.com> for spotting this bug
+
+4.029 Thu Jul 8 18:17:38 PDT 2010
+ In NetAddr::IP::Lite,
+ added support for the sub "new" to resolve host6 names
+ if the OPTIONAL perl Socket6 module is available
+
+ Thanks to "Mabe, Dusty" <Dusty.Mabe at tekelec.com> for spotting
+ this and suggesting a fix.
4.028 Wed May 12 14:18:20 PDT 2010
In /Lite/Util/Util.xs v1.32,
Modified: branches/upstream/libnetaddr-ip-perl/current/IP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnetaddr-ip-perl/current/IP.pm?rev=63689&op=diff
==============================================================================
--- branches/upstream/libnetaddr-ip-perl/current/IP.pm (original)
+++ branches/upstream/libnetaddr-ip-perl/current/IP.pm Thu Oct 14 06:53:49 2010
@@ -4,8 +4,8 @@
use strict;
#use diagnostics;
-use NetAddr::IP::Lite 1.13 qw(Zero Zeros Ones V4mask V4net);
-use NetAddr::IP::Util 1.32 qw(
+use NetAddr::IP::Lite 1.19 qw(Zero Zeros Ones V4mask V4net);
+use NetAddr::IP::Util 1.34 qw(
sub128
inet_aton
inet_any2n
@@ -34,7 +34,7 @@
@ISA = qw(Exporter NetAddr::IP::Lite);
-$VERSION = do { sprintf " %d.%03d", (q$Revision: 4.28 $ =~ /\d+/g) };
+$VERSION = do { sprintf " %d.%03d", (q$Revision: 4.33 $ =~ /\d+/g) };
=pod
@@ -1405,116 +1405,7 @@
=over 4
-=item 4.00
-
-Dependence on Math::BigInt in earlier version is removed in this release
-4.00. NetAddr::IP now works with earlier versions of Perl.
-The module was partitioned into three logical pieces as follows:
-
-Util.pm Math and logic operation on bit strings and number
- that represent IP addresses and masks. Conversions
- between various number formats. Implemented in
- C_XS for speed and PURE PERL of transportability.
-
-Lite.pm Operations, simple conversions and comparisons of
- IP addresses, notations and formats.
-
-IP.pm Complex operations and conversions of IP address
- notation, nets, subnets, and ranges.
-
-The internal representation of addresses was changed to 128 bit binary
-strings as returned by inet_pton (ipv6_aton in this module). Both
-ipV4 and ipV6 notations can be freely mixed and matched.
-
-Additional methods added to force operations into ipV6 space even when
-ipV4 notation is used.
-
-=item 4.05
-
- NetAddr::IP :aton DEPRECATED !
- new method "new_from_aton"
-
-THE FOLLOWING CHANGES MAY BREAK SOME CODE !
-
- Inherited methods from Lite.pm updated as follows:
-
- comparisons of the form <, >, <=, >=
-
- 10.0.0.0/24 {operator} 10.0.0.0/16
-
- return now return the comparison of the cidr value
- when the address portion is equal.
- Thanks to Peter DeVries for spotting this bug.
-
- ... and leading us to discover that this next fix is required
-
- comparisons of the form <=>, cmp
- now return the correct value 1, or -1
- when the address portion is equal and the CIDR value is not
- i.e. where /16 is > /24, etc...
-
- This is the OPPOSITE of the previous return values for
- comparison of the CIDR portion of the address object
-
-=item 4.08
-
- added method ->new_from_aton to supplement broken
- :aton functionality which is now DEPRECATED and
- will eventually go away.
-
-=item 4.13
-
- added 'no octal' method ->new_no
-
-=item 4.17
-
- add support for PTHREADS in the event that perl is
- built with <pthreads.h>. This must be invoked at build
- time with the switch --with-threads
-
- WARNING: --with-threads is not tested in a threads
- environment. Reports welcome and solicited.
-
- update _compV6 which runs faster and produces more
- compact ipV6 addresses.
- ....and
- added minus (-) overloading to allow the subtraction
- of two NetAddr::IP objects to get the difference between
- the object->{addr}'s as a numeric value
-
- Thanks to Rob Riepel <riepel at networking.Stanford.EDU> for
- the _compV6 code and the inspiration for (-) overloading.
-
- Extended the capability of 'splitref' to allow splitting of
- objects into multiple pieces with differing CIDR masks.
- Returned object list can be split from bottom to top
- or from top to bottom depending on which routine is called
-
- split, rsplit, splitref, rsplitref
-
- Thanks to kashmish <kashmish at gmail.com> for the idea on
- improving functionality of 'split'.
-
-=item 4.018
-
- removed --with-threads, PTHREADS support, and all
- the mutex locking - unlocking
-
- updated Util.xs to be fully re-entrant and thus
- fully thread safe.
-
-=item 4.020
-
- Fixed core dump due to bug in perl 5.8.4 handling of
- @_ in goto &sub operations. Unfortunately this version
- of perl is standard on Solaris, 5.85 on RedHat and I'm
- sure other distributions. -- all should be upgraded!
- Similar behavior exists in perl versions 5.80 - 5.85
- See perl bug [ 23429].
-
- Included missing code to parse BCD numbers as argument
- to sub new(bcdnum). Thanks to Carlos Vicente cvicente at cpan.org
- for reporting this bug.
+See the Changes file
=back
Modified: branches/upstream/libnetaddr-ip-perl/current/Lite/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnetaddr-ip-perl/current/Lite/Changes?rev=63689&op=diff
==============================================================================
--- branches/upstream/libnetaddr-ip-perl/current/Lite/Changes (original)
+++ branches/upstream/libnetaddr-ip-perl/current/Lite/Changes Thu Oct 14 06:53:49 2010
@@ -1,4 +1,29 @@
Revision history for Perl extension NetAddr::IP::Lite
+
+1.19 Wed Sep 29 10:32:50 PDT 2010
+ Conditionalize import of AF_INET6 in Util.pm
+ NetAddr::IP::UtilPolluted
+
+1.18 Wed Sep 22 13:39:08 PDT 2010
+ Added overload => 'ne' and '!=' to Lite.pm
+
+1.17 Tue Sep 21 17:50:50 PDT 2010
+ Pull Socket6 stuff out of Lite and put into
+ NetAddr::IP::Util.pm in its own namespace
+
+1.16 Wed Aug 11 12:45:49 PDT 2010
+ When using Socket6, pull in missing symbol PF_INET6, which may
+ or may not be present, from Socket.
+
+1.15 Tue Jul 20 15:32:23 PDT 2010
+ Resolve named hosts using gethostbyname, followed by gethostbyname6
+ to determine whether to set ipV6 flag
+
+ Thanks to Dusty Mabe <Dusty.Mabe at tekelec.com> for spotting this bug
+
+1.14 Thu Jul 8 18:17:38 PDT 2010
+ added support for the sub "new" to resolve host6 names
+ if the OPTIONAL perl Socket6 module is available
1.13 Tue Dec 9 16:00:35 PST 2008
added missing regexp to classify arguments as BCD numbers,
Modified: branches/upstream/libnetaddr-ip-perl/current/Lite/Lite.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnetaddr-ip-perl/current/Lite/Lite.pm?rev=63689&op=diff
==============================================================================
--- branches/upstream/libnetaddr-ip-perl/current/Lite/Lite.pm (original)
+++ branches/upstream/libnetaddr-ip-perl/current/Lite/Lite.pm Thu Oct 14 06:53:49 2010
@@ -24,10 +24,12 @@
ipv6_n2x
mask4to6
ipv4to6
+ naip_gethostbyname
);
+
use vars qw(@ISA @EXPORT_OK $VERSION $Accept_Binary_IP $Old_nth $AUTOLOAD *Zero);
-$VERSION = do { my @r = (q$Revision: 1.13 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+$VERSION = do { my @r = (q$Revision: 1.19 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
require Exporter;
@@ -205,9 +207,20 @@
$a eq $b;
},
+ 'ne' => sub {
+ my $a = (UNIVERSAL::isa($_[0],__PACKAGE__)) ? $_[0]->cidr : $_[0];
+ my $b = (UNIVERSAL::isa($_[1],__PACKAGE__)) ? $_[1]->cidr : $_[1];
+ $a ne $b;
+ },
+
'==' => sub {
return 0 unless UNIVERSAL::isa($_[0],__PACKAGE__) && UNIVERSAL::isa($_[1],__PACKAGE__);
$_[0]->cidr eq $_[1]->cidr;
+ },
+
+ '!=' => sub {
+ return 1 unless UNIVERSAL::isa($_[0],__PACKAGE__) && UNIVERSAL::isa($_[1],__PACKAGE__);
+ $_[0]->cidr ne $_[1]->cidr;
},
'>' => sub {
@@ -283,7 +296,7 @@
=item B<Equality>
-You can test for equality with either C<eq> or C<==>. C<eq> allows the
+You can test for equality with either C<eq>, C<ne>, C<==> or C<!=>. C<eq>, C<ne> allows the
comparison with arbitrary strings as well as NetAddr::IP::Lite objects. The
following example:
@@ -292,10 +305,7 @@
Will print out "Yes".
-Comparison with C<==> requires both operands to be NetAddr::IP::Lite objects.
-
-In both cases, a true value is returned if the CIDR representation of
-the operands is equal.
+Comparison with C<==> and C<!=> requires both operands to be NetAddr::IP::Lite objects.
=item B<Comparison via E<gt>, E<lt>, E<gt>=, E<lt>=, E<lt>=E<gt> and C<cmp>>
@@ -498,7 +508,9 @@
C<$addr> can be almost anything that can be resolved to an IP address
in all the notations I have seen over time. It can optionally contain
-the mask in CIDR notation.
+the mask in CIDR notation. If the OPTIONAL perl module Socket6 is
+available in the local library it will autoload and ipV6 host6
+names will be resolved as well as ipV4 hostnames.
B<prefix> notation is understood, with the limitation that the range
specified by the prefix must match with a valid subnet.
@@ -809,8 +821,15 @@
return undef if hasbits($ip & $tmp);
last;
}
+# check for resolvable IPv4 hosts
elsif ($ip !~ /[^a-zA-Z0-9\.-]/ && ($tmp = gethostbyname($ip)) && $tmp ne $_v4zero && $tmp ne $_zero ) {
$ip = ipv4to6($tmp);
+ last;
+ }
+# check for resolvable IPv6 hosts
+ elsif ($ip !~ /[^a-zA-Z0-9\.-]/ && ($tmp = naip_gethostbyname($ip))) {
+ $ip = $tmp;
+ $isV6 = 1;
last;
}
elsif ($Accept_Binary_IP && ! $hasmask) {
Modified: branches/upstream/libnetaddr-ip-perl/current/Lite/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnetaddr-ip-perl/current/Lite/README?rev=63689&op=diff
==============================================================================
--- branches/upstream/libnetaddr-ip-perl/current/Lite/README (original)
+++ branches/upstream/libnetaddr-ip-perl/current/Lite/README Thu Oct 14 06:53:49 2010
@@ -91,20 +91,17 @@
Will print the string
Equality
- You can test for equality with either "eq" or "==". "eq" allows the
- comparison with arbitrary strings as well as NetAddr::IP::Lite
- objects. The following example:
+ You can test for equality with either "eq", "ne", "==" or "!=".
+ "eq", "ne" allows the comparison with arbitrary strings as well as
+ NetAddr::IP::Lite objects. The following example:
if (NetAddr::IP::Lite->new('127.0.0.1','255.0.0.0') eq '127.0.0.1/8')
{ print "Yes\n"; }
Will print out "Yes".
- Comparison with "==" requires both operands to be NetAddr::IP::Lite
- objects.
-
- In both cases, a true value is returned if the CIDR representation
- of the operands is equal.
+ Comparison with "==" and "!=" requires both operands to be
+ NetAddr::IP::Lite objects.
Comparison via >, <, >=, <=, <=> and "cmp"
Internally, all network objects are represented in 128 bit format.
@@ -195,7 +192,9 @@
"$addr" can be almost anything that can be resolved to an IP address
in all the notations I have seen over time. It can optionally
- contain the mask in CIDR notation.
+ contain the mask in CIDR notation. If the OPTIONAL perl module
+ Socket6 is available in the local library it will autoload and ipV6
+ host6 names will be resolved as well as ipV4 hostnames.
prefix notation is understood, with the limitation that the range
specified by the prefix must match with a valid subnet.
Modified: branches/upstream/libnetaddr-ip-perl/current/Lite/Util/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnetaddr-ip-perl/current/Lite/Util/Changes?rev=63689&op=diff
==============================================================================
--- branches/upstream/libnetaddr-ip-perl/current/Lite/Util/Changes (original)
+++ branches/upstream/libnetaddr-ip-perl/current/Lite/Util/Changes Thu Oct 14 06:53:49 2010
@@ -1,4 +1,12 @@
Revision history for Perl extension NetAddr::IP::Util
+
+1.34 Wed Sep 29 10:32:50 PDT 2010
+ Conditionalize import of AF_INET6 in Util.pm
+ NetAddr::IP::UtilPolluted
+
+1.33 Tue Sep 21 17:50:50 PDT 2010
+ Add UtilPolluted namespace to contain name space pollution
+ created by "use Socket" when invoking Socket6.
1.32 Wed May 12 14:18:20 PDT 2010
In Util.xs,
Modified: branches/upstream/libnetaddr-ip-perl/current/Lite/Util/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnetaddr-ip-perl/current/Lite/Util/README?rev=63689&op=diff
==============================================================================
--- branches/upstream/libnetaddr-ip-perl/current/Lite/Util/README (original)
+++ branches/upstream/libnetaddr-ip-perl/current/Lite/Util/README Thu Oct 14 06:53:49 2010
@@ -26,6 +26,7 @@
bin2bcd
bcd2bin
mode
+ naip_gethostbyname
);
use NetAddr::IP::Util qw(:all :inet :ipv4 :ipv6 :math)
@@ -34,14 +35,14 @@
ipv6_n2x, ipv6_n2d, inet_any2n,
inet_n2dx, inet_n2ad, ipv4to6,
mask4to6, ipanyto6, maskanyto6,
- ipv6to4
+ ipv6to4, naip_gethostbyname
:ipv4 => inet_aton, inet_ntoa
:ipv6 => ipv6_aton, ipv6_n2x, ipv6_n2d,
inet_any2n, inet_n2dx, inet_n2ad
ipv4to6, mask4to6, ipanyto6,
- maskanyto6, ipv6to4
+ maskanyto6, ipv6to4, naip_gethostbyname
:math => hasbits, isIPv4, addconst,
add128, sub128, notcontiguous,
@@ -73,6 +74,7 @@
$bcdtext = bin2bcd($bits128);
$bits128 = bcd2bin($bcdtxt);
$modetext = mode;
+ ($name,$aliases,$addrtype,$length, at addrs)=naip_gethostbyname(NAME);
NetAddr::IP::Util::lower();
NetAddr::IP::Util::upper();
@@ -300,6 +302,9 @@
input: none
returns: "Pure Perl"
or "CC XS"
+
+ * ($name,$aliases,$addrtype,$length, at addrs)=naip_gethostbyname(NAME);
+ Replacement for Perl's gethostbyname if Socket6 is available
* NetAddr::IP::Util::lower();
Return IPv6 strings in lowercase.
@@ -421,6 +426,7 @@
bin2bcd
bcd2bin
mode
+ naip_gethostbyname
AUTHOR
Michael Robinton <michael at bizsystems.com>
Modified: branches/upstream/libnetaddr-ip-perl/current/Lite/Util/Util.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnetaddr-ip-perl/current/Lite/Util/Util.pm?rev=63689&op=diff
==============================================================================
--- branches/upstream/libnetaddr-ip-perl/current/Lite/Util/Util.pm (original)
+++ branches/upstream/libnetaddr-ip-perl/current/Lite/Util/Util.pm Thu Oct 14 06:53:49 2010
@@ -13,7 +13,7 @@
@ISA = qw(Exporter DynaLoader);
-$VERSION = do { my @r = (q$Revision: 1.32 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+$VERSION = do { my @r = (q$Revision: 1.34 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
@EXPORT_OK = qw(
inet_aton
@@ -44,6 +44,7 @@
bcdn2bin
simple_pack
comp128
+ naip_gethostbyname
);
%EXPORT_TAGS = (
@@ -62,6 +63,7 @@
ipanyto6
maskanyto6
ipv6to4
+ naip_gethostbyname
)],
math => [qw(
shiftleft
@@ -90,6 +92,7 @@
ipanyto6
maskanyto6
ipv6to4
+ naip_gethostbyname
)],
);
@@ -136,6 +139,63 @@
}
sub DESTROY {};
+
+my $mygethostbyname;
+
+package NetAddr::IP::UtilPolluted;
+
+# Socket pollutes the name space with all of its symbols. Since
+# we don't want them all, confine them to this name space.
+
+use strict;
+use Socket;
+
+sub DESTROY {};
+
+# invoke replacement subroutine for Perl's "gethostbyname"
+# if Socket6 is available.
+#
+my $_v4zero = pack('L',0);
+my $_zero = pack('L4',0,0,0,0);
+
+sub _end_gethostbyname {
+ my $tip = $_[0];
+ return 0 unless $tip && $tip ne $_v4zero && $tip ne $_zero;
+ my $len = length($tip);
+ if ($len == 4) {
+ return Util::ipv4to6($tip);
+ }
+ elsif ($len == 16) {
+ return $tip;
+ }
+ return 0;
+}
+
+unless (eval { require Socket6 }) {
+ $mygethostbyname = sub {
+ my $tip = gethostbyname($_[0]);
+ return &_end_gethostbyname($tip);
+ };
+} else {
+ import Socket6 qw( gethostbyname2 );
+ import Socket6 qw( AF_INET6 )
+ unless eval { &AF_INET6 };
+ my $tip;
+ $mygethostbyname = sub {
+ unless ($tip = gethostbyname2($_[0],&AF_INET6)) {
+ $tip = gethostbyname($_[0]);
+ }
+ return &_end_gethostbyname($tip);
+ };
+}
+
+package NetAddr::IP::Util;
+
+sub naip_gethostbyname {
+# turn off complaint from Socket6 about missing numeric argument
+ undef local $^W;
+ return &$mygethostbyname($_[0]);
+}
1;
__END__
@@ -170,6 +230,7 @@
bin2bcd
bcd2bin
mode
+ naip_gethostbyname
);
use NetAddr::IP::Util qw(:all :inet :ipv4 :ipv6 :math)
@@ -178,14 +239,14 @@
ipv6_n2x, ipv6_n2d, inet_any2n,
inet_n2dx, inet_n2ad, ipv4to6,
mask4to6, ipanyto6, maskanyto6,
- ipv6to4
+ ipv6to4, naip_gethostbyname
:ipv4 => inet_aton, inet_ntoa
:ipv6 => ipv6_aton, ipv6_n2x, ipv6_n2d,
inet_any2n, inet_n2dx, inet_n2ad
ipv4to6, mask4to6, ipanyto6,
- maskanyto6, ipv6to4
+ maskanyto6, ipv6to4, naip_gethostbyname
:math => hasbits, isIPv4, addconst,
add128, sub128, notcontiguous,
@@ -217,6 +278,7 @@
$bcdtext = bin2bcd($bits128);
$bits128 = bcd2bin($bcdtxt);
$modetext = mode;
+ ($name,$aliases,$addrtype,$length, at addrs)=naip_gethostbyname(NAME);
NetAddr::IP::Util::lower();
NetAddr::IP::Util::upper();
@@ -597,6 +659,10 @@
input: none
returns: "Pure Perl"
or "CC XS"
+
+=item * ($name,$aliases,$addrtype,$length, at addrs)=naip_gethostbyname(NAME);
+
+Replacement for Perl's gethostbyname if Socket6 is available
=item * NetAddr::IP::Util::lower();
@@ -726,6 +792,7 @@
bin2bcd
bcd2bin
mode
+ naip_gethostbyname
=head1 AUTHOR
@@ -766,4 +833,3 @@
=cut
1;
-
Modified: branches/upstream/libnetaddr-ip-perl/current/Lite/t/over_equal.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnetaddr-ip-perl/current/Lite/t/over_equal.t?rev=63689&op=diff
==============================================================================
--- branches/upstream/libnetaddr-ip-perl/current/Lite/t/over_equal.t (original)
+++ branches/upstream/libnetaddr-ip-perl/current/Lite/t/over_equal.t Thu Oct 14 06:53:49 2010
@@ -4,7 +4,7 @@
$| = 1;
-print "1..8\n";
+print "1..14\n";
my $test = 1;
sub ok() {
@@ -17,6 +17,11 @@
my $t432 = '0.0.0.4/32';
my $t4120 = '0:0:0:0:0:0:0:4/120';
+my $five = new NetAddr::IP::Lite('0.0.0.5');
+my $t532 = '0.0.0.5/32';
+
+
+# 1
## test '""' overload
my $txt = sprintf ("%s",$four120);
@@ -24,6 +29,7 @@
unless $txt eq $t4120;
&ok;
+# 2
## test '""' again
$txt = sprintf ("%s",$four);
@@ -31,33 +37,86 @@
unless $txt eq $t432;
&ok;
+# 3
## test 'eq' to scalar
print 'failed ',$four," eq $t432\nnot "
unless $four eq $t432;
&ok;
+# 4
## test scalar 'eq' to
print "failed $t432 eq ",$four,"\nnot "
unless $t432 eq $four;
&ok;
+# 5
## test 'eq' to self
print 'failed ',$four,' eq ', $four,"\nnot "
unless $four eq $four;
&ok;
+# 6
## test 'eq' cidr !=
print 'failed ',$four,' should not eq ',$four120,"\nnot "
if $four eq $four120;
&ok;
+# 7
## test '==' not for scalars
print "failed scalar $t432 should not == ",$four,"\nnot "
if $t432 == $four;
&ok;
+# 8
## test '== not for scalar, reversed args
print 'failed scalar ',$four," should not == $t432\nnot "
if $four == $t432;
&ok;
+# ==========================================
+#
+# test "ne" and "!="
+#
+# 9
+## test 'ne' to scalar
+print 'failed ',$four120," ne $t432\nnot "
+ unless $four120 ne $t432;
+&ok;
+
+# 10
+## test scalar 'ne' to
+print "failed $t432 ne ",$four120,"\nnot "
+ unless $t432 ne $four120;
+&ok;
+
+# 11
+## test 'ne' to cidr
+print 'failed ',$four,' ne ', $four120,"\nnot "
+ unless $four ne $four120;
+&ok;
+
+# 12
+## test '!=' not for scalar, reversed args
+$rv = $five != $four ? 1 : 0;
+#print "rv=$rv\n";
+print "failed scalar $five != $four\nnot "
+ unless $rv;
+&ok;
+
+# unblessed scalars not welcome
+undef local $^W;
+# 13
+## test '!=' not for scalars
+my $rv = $t432 != $five ? 1 : 0;
+#print "rv=$rv\n";
+print "failed scalar $t432 != ",$five,"\nnot "
+ unless $rv;
+&ok;
+
+# 14
+# since both of these are string scalars, the != should fail
+$rv = $t532 != $t432 ? 1 : 0;
+#print "rv = $rv\n";
+print "failed scalar $t532 != $t432\nnot "
+ if $rv;
+&ok;
Modified: branches/upstream/libnetaddr-ip-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnetaddr-ip-perl/current/META.yml?rev=63689&op=diff
==============================================================================
--- branches/upstream/libnetaddr-ip-perl/current/META.yml (original)
+++ branches/upstream/libnetaddr-ip-perl/current/META.yml Thu Oct 14 06:53:49 2010
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: NetAddr-IP
-version: 4.028
+version: 4.033
abstract: Manages IPv4 and IPv6 addresses and subnets
license: ~
author:
More information about the Pkg-perl-cvs-commits
mailing list