in reply to IP Iterator

See Perl Hacks by Chromatic, Damian CONWAY and Curtis POE, chapter 3, page #66 :
Iterate and Generate Expensive Data

hth,
PooLpi

'Ebry haffa hoe hab im tik a bush'. Jamaican proverb

Replies are listed 'Best First'.
Re^2: IP Iterator
by camlet (Novice) on Apr 17, 2008 at 20:14 UTC
    after reading page 66 chapter 3 yes this is similar to what is being accomplished with the ip iterator. although the missing module issue. not all systems have that package installed. similar to the other solution below with Net::IP; the idea behind the tool is to monitor for new servers that are added to the network that can then be picked up from ip iterator and deploy a monitor agent or starting pinging for availability in response. both Net::IP and Net::Netmask may not be installed on the server. hth.

    Unix

    lpar23ml162f_pub[/opt/camlet/lib] > ./test2.pl Can't locate Net/Netmask.pm in @INC (@INC contains: /usr/opt/perl5/lib +/5.8.2/aix-thread-multi /usr/opt/perl5/lib/5.8.2 /usr/opt/perl5/lib/s +ite_perl/5.8.2/aix-thread-multi /usr/opt/perl5/lib/site_perl/5.8.2 /u +sr/opt/perl5/lib/site_perl .) at ./test2.pl line 3. BEGIN failed--compilation aborted at ./test2.pl line 3.

    Linux

    [camlet@cam-lin-s04 tmp]# ./test2.pl Can't locate Net/Netmask.pm in @INC (@INC contains: /usr/lib/perl5/sit +e_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i +386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thre +ad-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/ +lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/per +l5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site +_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/l +ib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/ven +dor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8 +.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/ +perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/per +l5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/ +i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./test2.pl line 3. BEGIN failed--compilation aborted at ./test2.pl line 3. [root@cam-lin-s04 tmp]#
Re^2: IP Iterator
by camlet (Novice) on Apr 20, 2008 at 02:28 UTC
    PooLpi, thanks for the recommending the book i just pick up a copy. its a pretty good read with a lot of practical examples.
Re^2: IP Iterator
by camlet (Novice) on Apr 17, 2008 at 18:00 UTC
    looks like a good book. if it were a simple iterator you could just write a for loop. carrying the ++i to the next octet and checking that 255 max was the reason a simple loop didn't work.