From owner-freebsd-questions Mon Jul 5 9: 8:14 1999 Delivered-To: freebsd-questions@freebsd.org Received: from elmls02.ce.mediaone.net (elmls02.ce.mediaone.net [24.131.128.27]) by hub.freebsd.org (Postfix) with ESMTP id 1E06514C05 for ; Mon, 5 Jul 1999 09:08:08 -0700 (PDT) (envelope-from burke@mcs.net) Received: from fatman2 (el01-24-131-147-32.ce.mediaone.net [24.131.147.32]) by elmls02.ce.mediaone.net (8.8.7/8.8.7) with SMTP id LAA16115; Mon, 5 Jul 1999 11:08:06 -0500 (CDT) Message-Id: <4.1.19990705110113.00a749e0@pop.ce.mediaone.net> X-Sender: johnburke@pop.ce.mediaone.net X-Mailer: QUALCOMM Windows Eudora Pro Version 4.1 Date: Mon, 05 Jul 1999 11:08:06 -0500 To: freebsd-questions@freebsd.org From: Burke Gallagher Subject: Re: running frequent cron perl scripts Cc: junkmale@xtra.co.nz In-Reply-To: <19990705111124.ZBJY282564.mta1-rme@wocker> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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