December 2000
Intermediate to advanced
784 pages
20h 54m
English
This module contains utilities for working with odd-sized netmasks. With it you can easily determine the appropriate broadcast and network addresses for any combination of netmask and IP address. Examine the hostpart(), netpart(), network(), and broadcast() methods to learn the numeric relationships among these parts of the IP address and its netmask.
David Sharnoff's Net::Netmask module, available on CPAN, provides more functionality and is recommended for production work.
0 package Net::NetmaskLite; 1 # file: Net/NetmaskLite.pm; 2 use strict; 3 use Carp 'croak'; 4 use overload '""'=>netmask; 5 sub new { 6 my $pack = shift; 7 my $mask = shift or croak "Usage: Netmask->new(\$dotted_IP_addr)\n"; 8 my $num = ($mask ...Read now
Unlock full access