in reply to Net::IP convert ip to int

The value of 291 seems awfully high. Most of the ip's that I work with have 0, 1, or 2, sometimes more. They refer to the number of prefixes, "/nn", for point-to-point networks. The + sign means that it has been signed with an extra 32-bit integer, again, for point-to-point broadcast purposes. It may make more sense if we look at the whole bundle of methods.
#!/usr/bin/perl -l use strict; use warnings; use Net::IP qw/:PROC/; use Data::Dumper::Concise; my $netip = new Net::IP ('157.166.255.18') or die (Net::IP::Error()); print Dumper( "IP : " . $netip->ip(), "Sho : " . $netip->short(), "Bin : " . $netip->binip(), "Int : " . $netip->intip(), "Mask : " . $netip->mask(), "Last : " . $netip->last_ip(), "Len : " . $netip->prefixlen(), "Size : " . $netip->size(), "Type : " . $netip->iptype(), "Rev : " . $netip->reverse_ip(), "Pre : " . $netip->is_prefix(), ); print Dumper( $netip );
You'll be able to get more information from a post by the author: Managing your IP space with Perl.

Replies are listed 'Best First'.
Re^2: Net::IP convert ip to int
by Anonymous Monk on Jun 23, 2012 at 10:59 UTC