CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
range2cidrlist($startip, $endip) Module Net::Netmask exact meaning

 



sh.ajay12
User

Jan 2, 2014, 8:51 AM

Post #1 of 3 (1556 views)
range2cidrlist($startip, $endip) Module Net::Netmask exact meaning Can't Post

Hello Members,

range2cidrlist($startip, $endip) is a function of Module Net::Netmask

Can you please tell me what is the meaning of the above function, and how can we use above function.

Please give me a example with above function.

Thank You for reply.


wickedxter
User

Jan 2, 2014, 12:56 PM

Post #2 of 3 (1552 views)
Re: [sh.ajay12] range2cidrlist($startip, $endip) Module Net::Netmask exact meaning [In reply to] Can't Post

look at the POD on the module.
https://metacpan.org/pod/release/MUIR/Net-Netmask-1.9019/lib/Net/Netmask.pod


Quote
range2cidrlist($startip, $endip)

Given a range of IP addresses, return a list of blocks that span that range.

For example, range2cidrlist('216.240.32.128', '216.240.36.127'), will return a list of Net::Netmask objects that corrospond to:


Code
216.240.32.128/25 
216.240.33.0/24
216.240.34.0/23
216.240.36.0/25



useage:

Code
my $beginip = "216.240.32.128"; 
my $endip = "216.240.36.127";

my @blocks = range2cidrlist($beginip, $endip);



sh.ajay12
User

Jan 2, 2014, 10:35 PM

Post #3 of 3 (1543 views)
Re: [wickedxter] range2cidrlist($startip, $endip) Module Net::Netmask exact meaning [In reply to] Can't Post

wickedxter, so these are again 216.240.32.128/25
216.240.33.0/24
216.240.34.0/23
216.240.36.0/25

ranges of ip address. am i correct ??

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives