From owner-freebsd-questions Fri Mar 29 7:11:48 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mail.happcontrols.com (mail.happcontrols.com [12.15.19.237]) by hub.freebsd.org (Postfix) with ESMTP id 60F5D37B400 for ; Fri, 29 Mar 2002 07:11:43 -0800 (PST) Received: from CONDOR.happcontrols.com (sniper.happcontrols.com [12.15.19.193]) by mail.happcontrols.com (8.12.1/8.12.1) with ESMTP id g2TF8bJm061022 for ; Fri, 29 Mar 2002 09:08:38 -0600 (CST) Message-Id: <5.1.0.14.0.20020329085816.065885d8@mail.happcontrols.com> X-Sender: ben@mail.happcontrols.com X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Fri, 29 Mar 2002 09:08:37 -0600 To: freebsd-questions@freebsd.org From: Ben Kadish Subject: Determining local IP(s) Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello All, I'm writing a Perl script for which I'm trying to determine if a certain IP is bound to a given NIC. I was trying to do it by regex matching the output of ifconfig as follows: $ifconfig = `ifconfig`; if ($ifconfig =~ m/. $IPADDRESS ./) { execute this code; } I got to thinking that this was grossly inefficient, and since it wasn't working anyway, I started wondering if there is a more efficient way to do this in Perl with some system functions I didn't know about. I looked through the sysctl variables and environment variables to no avail. Any ideas? - ---------- Ben Kadish Ben.Kadish@happcontrols.com Network Analyst Happ Controls, Inc. GnuPG Public Key 86EEC8F6 available from http://wwwkeys.us.pgp.net - ---------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (MingW32) Comment: For info see http://www.gnupg.org iD8DBQE8pINgqpnDV4buyPYRAhWPAKCBkCkFTsf/CFyK59BbEbzcBytzFQCg2cDe bahrMhHGtKlz57ZL/bX0Xcw= =noVb -----END PGP SIGNATURE----- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message