in reply to ip address calculations
Socket the inet() functions and pack and unpack can do the first job. This takes under a second to run:
use Socket; my $begin = "172.16.0.1"; my $end = "172.17.3.10"; my $ip = unpack N, inet_aton($begin); my $ip_end = unpack N, inet_aton($end); while ( $ip <= $ip_end ) { print inet_ntoa(pack N,$ip), "\n"; $ip++; }
NetAddr::IP does the rest.
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: ip address calculations
by arc_of_descent (Hermit) on May 06, 2002 at 13:30 UTC |
In Section
Seekers of Perl Wisdom