vwyoda has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use warnings; use File::Slurp; use LWP::Simple; use Time::localtime; # Location of file to write to my $addresses = '/home/blimpton/Pro/logger/addresses.txt'; # Find out what the external IP is my $ip = get('https://automation.whatismyip.com/n09230945.asp'); $ip = 'Could find ip address!' if !$ip; # Current Date my $month = localtime->mon + 1; my $day = localtime->mday; my $year = localtime->year + 1900; my $current_date = "$month-$day-$year"; # Write to the file if ($ip = write_file($addresses, {append => 1}, $ip . ',' . $current_d +ate . "\n"));
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Getting external IP
by Kenosis (Priest) on Jun 28, 2012 at 22:37 UTC | |
by vwyoda (Initiate) on Jun 28, 2012 at 22:49 UTC | |
by Kenosis (Priest) on Jun 28, 2012 at 22:55 UTC | |
by vwyoda (Initiate) on Jun 28, 2012 at 23:15 UTC | |
by Kenosis (Priest) on Jun 28, 2012 at 23:19 UTC | |
|
Re: Getting external IP
by Corion (Patriarch) on Jun 28, 2012 at 22:04 UTC | |
by vwyoda (Initiate) on Jun 28, 2012 at 22:45 UTC | |
|
Re: Getting external IP
by Anonymous Monk on Jun 29, 2012 at 11:32 UTC |