Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 ( #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? | Other CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2023-02-07 01:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (38 votes). Check out past polls.

    Notices?