Last active
December 16, 2015 23:29
-
-
Save digizeph/5513982 to your computer and use it in GitHub Desktop.
This is a perl script that helps you retrive your public IP address. This is useful if your terminal is located in a private network with NAT to access internet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use LWP::Simple; | |
my @lines=split("\n",get("http://myip.dk")); | |
foreach my $line (@lines) | |
{ | |
if($line =~ />([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)</) | |
{ | |
print "found : $1\nin line $line\n"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment