Import of LUISMUNOZ/NetAddr-IP-2.23 from CPAN.
gitpan-cpan-distribution: NetAddr-IP
gitpan-cpan-version:      2.23
gitpan-cpan-path:         LUISMUNOZ/NetAddr-IP-2.23.tar.gz
gitpan-cpan-author:       LUISMUNOZ
gitpan-cpan-maturity:     released
1 parent 49f2ded commit f41080bc7f08c27658809d70bd8387888398806d
@Luis Muñoz Luis Muñoz authored on 16 Aug 2001
Gitpan committed on 21 Oct 2014
Showing 2 changed files
View
5
Changes
2.22 Wed Mar 28 2001
- Some changes suggested by Jeroen Ruigrok and Anton Berezin were
included. Thanks guys!
 
2.23 Tue Aug 14 2001
- Bug fix for /XXX.XXX.XXX.XXX netmasks under v5.6.1 suggested
by Tim Wuyts. Thanks!
- Tested the module under MACHTYPE=hppa1.0-hp-hpux11.00
 
View
14
IP.pm
@EXPORT_OK = qw( $Use_CIDR_Notation $Always_Display_Mask
);
 
$VERSION = '2.22';
$VERSION = '2.23';
 
 
# Preloaded methods go here.
 
$nmask;
}
 
sub new {
my $type = shift;
my $class = ref($type) || $type || "NetAddr::IP";
my $ip = shift;
my $mask = shift;
my $bits = shift;
my $type = shift;
my $class = ref($type) || $type || "NetAddr::IP";
my $ip = shift;
my $mask = shift;
my $bits = shift;
if (defined $bits and length $bits) {
my $min = $ip;
$ip = _number_to_addr($min);
if ($ip =~ /\/([\d\.]+)$/) {
# croak "inconsistent mask. Use only one form of netmask"
return undef if defined $mask;
my $m = $1;
$ip =~ s/\/\d+$//;
$ip =~ s/\/[\d\.]+$//;
$mask = $m;
}
$mask = "32" unless defined $mask; # Assume a host mask if none is given
if ($mask =~ /\./) {