top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

How to find next subnet in perl

+1 vote

How do I find the next subnet? This should print the second time - it errors:

#!/usr/bin/env perl

use strict;
use warnings;

use Net::IP;

my $ip = Net::IP->new('');

print "Start ip [" . $ip->ip . "]n";
print "start mask [" . $ip->prefixlen . "]n";

$ip->set($ip->ip . "/" . $ip->prefixlen);

print "Start ip [" . $ip->ip . "]n";
print "start mask [" . $ip->prefixlen . "]n";

 % ./
Start ip []
start mask [24]

Can't call method "ip" on an undefined value at ./ line 15.

posted May 24, 2013 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

Similar Questions
+1 vote

I have tried to install module PDF::FromHTML from cpan but not able to get it.
Please let me know any other module to do the same. please help

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.