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

Re^2: Need to calculate IP address

by haukex (Archbishop)
on Dec 28, 2017 at 19:34 UTC ( [id://1206353]=note: print w/replies, xml ) Need Help??


in reply to Re: Need to calculate IP address
in thread Need to calculate IP address

s/\d+$/ $& ^ 1 /er

A neat solution, of course, but unfortunately it doesn't meet the OP's specs: .5 becomes .4 and .6 becomes .7.

Replies are listed 'Best First'.
Re^3: Need to calculate IP address
by tybalt89 (Monsignor) on Dec 28, 2017 at 19:44 UTC

    I think the example is wrong. What should a 0 become? Or a 9?

      It will never be a 0. If the IP ends in .9, it needs to become .10. .10 would become .9. .29 would become .30, etc.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-19 21:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found