On Wed, Nov 27, 2002 at 07:33:27AM -0800, Admin-Stress wrote: >Hi, > >Is there any ready to use perl module for IP address calculation? >For example: I have an IP Address and Netmask, then I need to calculate the broadcast >and network. >
This should come in handy http://jodies.de/ipcalc.pl there is a link to the source at the bottom or this (by JHR IV) #!/usr/bin/perl for ( $ip=0; $ip<33; $ip++) { $q1=$num/ ( 256**3) % 256; $q2=$num/ ( 256**2) % 256; $q3=$num/ ( 256**1) % 256; $q4=$num/ ( 256**0) % 256; print "$q1.$q2.$q3.$q4/$ip\n"; $num+=2**(31-$ip); } and red hat ships 'ipcalc' as part of the initscripts rpm // George -- GEORGE GEORGALIS, System Admin/Architect cell: 347-451-8229 Security Services, Web, Mail, mailto:[EMAIL PROTECTED] Multimedia, DB, DNS and Metrics. http://www.galis.org/george -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]