Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Script to input IP Address and Subnet Bits (10.3.2.0/28)

by McDarren (Abbot)
on Dec 03, 2005 at 15:40 UTC ( [id://513816]=note: print w/replies, xml ) Need Help??


in reply to Script to input IP Address and Subnet Bits (10.3.2.0/28)

You might want to look at Data::Validate::IP
  • Comment on Re: Script to input IP Address and Subnet Bits (10.3.2.0/28)

Replies are listed 'Best First'.
Re^2: Script to input IP Address and Subnet Bits (10.3.2.0/28)
by ikegami (Patriarch) on Dec 03, 2005 at 17:33 UTC
    It doesn't check for range, so you can do:
    use Data::Validate::IP qw(is_ipv4); my $ip_w_mask = '10.3.2.0/28'; my ($ip, $mask) = m{^(.*)/(\d+)$} or die("Incorrect format: Mask not found\n"); is_ipv4($ip) or die("Incorrect format: Malformed IP address\n");

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://513816]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2024-04-23 11:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found