Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  
Server Error (Error ID 4430804b87190)

An error has occurred. The site administrators have been notified of the problem and will likely soon fix it. We thank you, for you're patients.

Server Error (Error ID 695719b87190)

An error has occurred. The site administrators have been notified of the problem and will likely soon fix it. We thank you, for you're patients.

Need Help??

Help for this page

Select Code to Download


  1. or download this
    use NetAddr::IP;
    my $ip = new NetAddr::IP '127.0.0.1';
    
  2. or download this
    use NetAddr::IP;
    my $loopback = new NetAddr::IP '127.0.0.1', '255.0.0.0';
    my $rfc1918 = new NetAddr::IP '10.0.0.0/8';
    my $another = new NetAddr::IP '1.2.0.0/255.255.0.0';
    my $loopback2 = new NetAddr::IP 'loopback';
    
  3. or download this
    use NetAddr::IP;
    my $ip = new NetAddr::IP('10.0.0.0/30');
    ...
      print "ip = $ip\n";
      $ip ++;
    }
    
  4. or download this
    ip = 10.0.0.0/30
    ip = 10.0.0.1/30
    ip = 10.0.0.2/30
    
  5. or download this
    use NetAddr::IP;
    my $ip = new NetAddr::IP('10.0.0.0/30');
    print join(' ', @$ip), "\n";
    
  6. or download this
    10.0.0.1/32 10.0.0.2/32
    
  7. or download this
    use NetAddr::IP;
    
    ...
    10.0.64.0/18
    10.0.192.0/18
    10.0.160.0/19
    
  8. or download this
    use NetAddr::IP;
    
    print "My address space contains the following /24s:\n", 
        join("\n", NetAddr::IP->new('10.0.0.0/22')->split(24)), "\n";
    
  9. or download this
    use NetAddr::IP;
    
    print join(' ', NetAddr::IP->new('10.0.0.0/25')->wildcard());
    
  10. or download this
    use NetAddr::IP;
    
    ...
    10.128.0.41
    10.128.0.17
    10.128.0.19
    
  11. or download this
    use NetAddr::IP;
    
    ...
    __DATA__
    10.0.0.0/16
    172.16.0.0/24
    
  12. or download this
    use NetAddr::IP;
    
    ...
    __DATA__
    10.0.0.0/16
    172.16.0.0/24
    
  13. or download this
    use NetAddr::IP;
    
    ...
    __DATA__
    10.0.0.0/16
    172.16.0.0/24
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perltutorial [id://190497]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2017-12-14 21:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (410 votes). Check out past polls.

    Notices?