#!/usr/bin/perl


 use NetAddr::IP::Count;
  use NetAddr::IP;

  my $counter = new NetAddr::IP::Count;

  $counter->add('subnet-00', new NetAddr::IP("10.0.0.0/24"));
  $counter->add('other', @array_of_ip_addresses);
  $counter->add('other', @another_array_of_ip_addresses);

  $counter->cache(10);

  $counter->count(new NetAddr::IP("10.0.3.17"));
  $counter->count(@array_of_ip_addresses);

  $counter->valcount(new NetAddr::IP("10.0.3.17"), 23);
  @array_of_ipaddr_and_values = (new NetAddr::IP("10.0.3.17"), 23,
                                new NetAddr::IP("101.0.23.107"), 2);
  $counter->valcount(@array_of_ipaddr_and_values);

  my $r_count = $counter->result;

  foreach my $subnet (keys %{$r_count}) {
      print "Subnet $subnet had ", $r_count->{$subnet}, " visits.\n";
  }
