Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Script to Notify of Public IP Change

by Kenosis (Priest)
on Nov 29, 2012 at 16:37 UTC ( #1006296=note: print w/ replies, xml ) Need Help??

in reply to Script to Notify of Public IP Change

marto makes a good point about asking the ISP about whether a static or dynamic IP is provided. In the meantime, perhaps something like the following would be helpful:

#!/usr/bin/env perl use strict; use warnings; use LWP::Simple; use Regexp::Common qw/net/; my $ip; for ( 0 .. 9 ) { chomp( $ip = get('') ); last if defined $ip and $ip =~ /$RE{net}{IPv4}/; sleep 1; } ...

Comment on Re: Script to Notify of Public IP Change
Download Code
Replies are listed 'Best First'.
Re^2: Script to Notify of Public IP Change
by Arkevius (Initiate) on Nov 29, 2012 at 16:52 UTC
    There seems to be a much faster response time (at least for me) with that address than with the one I currently use. I may very well substitute that bit of code with yours. Thank you for the contribution. I do agree with marto that the best solution would be talk with the ISP. However, in the interest of continuing my experience and learning of Perl, I went with the script, at least for now. I just wanted to clear up the cause of the blank address, which seems to just be an error in parsing the address.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1006296]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2015-11-27 02:30 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (713 votes), past polls