#! /usr/bin/perl use strict; use warnings; my $oldip = ''; while (1){ my$ip = `wget -q http://automation.whatismyip.com/n09230945.asp -O-`; my @t = localtime(); $t[5] += 1900; my $date = $t[5] . '-' . $t[4] . '-' . $t[3] . ' ' . $t[2] . ':' . $t[1]; if ("$ip" ne "$oldip"){ print "IP changed on $date from \"$oldip\" to \"$ip\"\n"; $oldip = $ip; } else { print "IP unchanged on $date. Is: \"$ip\"\n"; } sleep 15; }