Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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; } ...

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]
[Corion]: A good morning to everybody ;)

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2018-06-24 06:26 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.