http://www.perlmonks.org?node_id=953983


in reply to persistent new line

Other than the obvious recommendations of 'use strict; use warnings;', the 3-argument preferred call to 'open' and the fact that $oldip won't be defined the first time through, it works for me on Windows:

vincen_m@C:\Users\vincen_m\tmp> test.pl SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc syswgetrc = c:/progra~1/wget/etc/wgetrc 2012-02-15 10:42:07 URL:http://whatsmyip.net/ [6184] -> "index.html" [ +1] SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc syswgetrc = c:/progra~1/wget/etc/wgetrc 2012-02-15 10:42:12 URL:http://whatsmyip.net/ [6184] -> "index.html" [ +1] ...

With output in 'ipchanges.log' of:

vincen_m@C:\Users\vincen_m\tmp> tail -f ipchanges.log ***Wednesday February 15, 2012 10:42:07 AM Eastern Standard Time***@** +*65.65.65.65***CHANGED*** ***Wednesday February 15, 2012 10:42:12 AM Eastern Standard Time***@** +*65.65.65.65***SAME*** ***Wednesday February 15, 2012 10:42:18 AM Eastern Standard Time***@** +*65.65.65.65***SAME*** ...

NOTE: My IP was manually change in output before posting this, I had to change the 'date' command to 'clock.exe' which is a program I have that emulates the *nix 'date' command as Windows has a 'date' command that does something different and I have 'wget.exe' for Windows installed.