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.


In reply to Re: persistent new line by VinsWorldcom
in thread persistent new line by enkibian

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.