Subject: | Code or Documenation Bug For ip_range_to_prefix |
The documentation for ip_range_to_prefix shows that you pass it the
first and last IP along with a version.
ip_range_to_prefix
Return all prefixes between two IPs.
Params : First IP, Last IP, IP version
Returns : List of Prefixes or undef (problem)
The prefixes returned have the form q.q.q.q/nn.
@prefix = ip_range_to_prefix ($ip1,$ip2,6);
Passing it strings (like you do with ip_is_ipv4) returns an empty list.
Passing it Net::IP objects results in a fatal error:
Operation "eq": no method found,
left argument in overloaded package Net::IP,
right argument in overloaded package Net::IP at
/usr/lib/perl5/vendor_perl/5.8.8/Net/IP.pm line 1306.
I looked at the code and it is expecting you to pass it a binary IP.
# Subroutine ip_range_to_prefix
# Purpose : Return all prefixes between two IPs
# Params : First IP, Last IP, IP version
# Returns : List of Prefixes or undef (problem)
sub ip_range_to_prefix {
my ($binip, $endbinip, $ip_version) = @_;