Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 05 Jul 1999 11:08:06 -0500
From:      Burke Gallagher <burke@mcs.net>
To:        freebsd-questions@freebsd.org
Cc:        junkmale@xtra.co.nz
Subject:   Re: running frequent cron perl scripts
Message-ID:  <4.1.19990705110113.00a749e0@pop.ce.mediaone.net>
In-Reply-To: <19990705111124.ZBJY282564.mta1-rme@wocker>

next in thread | previous in thread | raw e-mail | index | archive | help
At 11:08 PM 7/5/99 +1200, you wrote:
>I'm running cron job to start up a perl script.  The script accesses the 
>ADSL modem to see if the external IP address has changed.  If it has, it 
>runs another job to update the DNS.  The ADSL modem has an http interface 
>which has the details I need.
>
>The perl script takes about 35 seconds to run on this old 486.  But I'm 
>guessing that most of that is overhead.  The first bit of the script is:
>
>#!/usr/bin/perl
>$| = 1;
>use CGI;
>use CGI::Carp (fatalsToBrowser);
>require LWP;
>
>Is there a way to speed this process up?  The above bits seem to take up 
>most of the time.

assuming that everything you need is on a single http request you can
eliminate all of the modules and just do the socket work in your perl
script a simple open of port 80.  send the http request (a constant string)
and recv the http response and html page.  close the socket. regex search
for your external address string and you are done.

If you need more details or an example script please let me know I would be
happy to help

burke
burke@mcs.net


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4.1.19990705110113.00a749e0>