in reply to Need to calculate IP address
#!/usr/bin/perl # http://perlmonks.org/?node_id=1206349 use strict; use warnings; print "Enter the IP address\n"; my $tunip = <STDIN>; chomp ($tunip); print $tunip =~ s/\d+$/ ($& - 1 ^ 1) + 1 /er, "\n";
Updated conversion
Updated again
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Need to calculate IP address
by haukex (Archbishop) on Dec 28, 2017 at 19:34 UTC | |
by tybalt89 (Monsignor) on Dec 28, 2017 at 19:44 UTC | |
by ddrew78 (Beadle) on Dec 28, 2017 at 20:01 UTC |