Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Need to calculate IP address

by thanos1983 (Parson)
on Dec 29, 2017 at 15:38 UTC ( [id://1206421]=note: print w/replies, xml ) Need Help??


in reply to Need to calculate IP address

Hello ddrew78,

It looks the fellow Monks, have answered your question. I just wanted to add something minor here.

What you are trying to achieve is also possible to be done with the module NetAddr::IP.

Sample of code:

#!/usr/bin/perl use strict; use warnings; use NetAddr::IP; use feature 'say'; say NetAddr::IP->new('127.0.0.1/8') + 255; say NetAddr::IP->new('127.0.1.6/8') - 255; __END__ $ perl test.pl 127.0.1.0/8 127.0.0.7/8

Hope this helps, BR.

Seeking for Perl wisdom...on the process of learning...not there...yet!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2024-03-28 18:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found