Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting your external ip with perl
#1
You can get your external ip with perl by running this script...however, you have to install the LWP::Simple first. If you are on mac or linux you can simply go to the command line and type:
sudo cpan
You may have to set up cpan, for the most part you use all defaults, and choose servers near you.
then run
install LWP::Simple
cpan may ask you some more questions, just agree.

Then you can run this:

PHP Code:
#!/usr/bin/perl
use LWP::Simple;
$whyip qr/(Your IP address is \d+\.\d+\.\d+.\d+)/;
$content get("http://whatismyipaddress.com");
if(
$content =~ $whyip){
 print $&;


If you don't know your path to perl(#!/usr/bin/perl) then run it by typing
perl nameofscript.pl
Reply


Messages In This Thread
Getting your external ip with perl - by bsdpunk - 10-21-2009, 01:38 PM
RE: Getting your external ip with perl - by Julie - 05-09-2010, 03:08 PM
RE: Getting your external ip with perl - by Arеs - 11-01-2010, 09:13 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Compile Error in Perl liveproject101 0 1,160 04-12-2013, 03:08 AM
Last Post: liveproject101
  [Perl] IRC Bot wchar_t 26 12,913 08-20-2012, 01:40 PM
Last Post: Trump
  Perl Ebook ven0m 2 1,636 05-04-2012, 08:14 AM
Last Post: ven0m
  Help with a program written in perl Rodman42866 1 1,536 03-09-2012, 03:16 AM
Last Post: AceInfinity
  HTML perl script AceInfinity 5 2,416 12-03-2011, 11:35 PM
Last Post: Closed Account

Forum Jump:


Users browsing this thread: 2 Guest(s)