[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Re: need help with `hostname`



At 16.52 -0500 1999.02.12, Quentin Smith wrote:
>I need some help with part of a MacPerl script I wrote. The command
>`hostname` returns the current hostname, but how do I get the current IP
>address?

I replied to your query about this last week on alt.comp.lang.applescript.

Path:
server1.news.adelphia.net!router1.news.adelphia.net!server1.news.adelphia.net.PO
STED!not-for-mail
From: pudge@pobox.com (Chris Nandor)
Newsgroups: alt.comp.lang.applescript
Subject: Re: need help with `hostname`
Message-ID: <pudge-0702991651230001@192.168.0.77>
References: <79l07h$pc9$1@news2.bit-net.com>
Organization: Pudge.Net
X-Newsreader: MT-NewsWatcher 2.4.4
X-Face: $!7l?58&Lro>GQtr;A/P^'38=7{P[jPy/?JF*m`Z2&~@3:P3L81Sa7RQ=Y~o|
        ?'D1cB]L9V=\OS(\8S,5
X-Quote: The Stones, I love the Stones.  I watch them whenever I can. Fred,
 Barney...
                 --Steven Wright
Lines: 17
Date: Sun, 07 Feb 1999 16:51:23 -0500
NNTP-Posting-Host: 24.48.30.154
X-Trace: server1.news.adelphia.net 918424281 24.48.30.154 (Sun, 07 Feb 1999
16:51:21 EDT)
NNTP-Posting-Date: Sun, 07 Feb 1999 16:51:21 EDT
Xref: router1.news.adelphia.net alt.comp.lang.applescript:936

In article <79l07h$pc9$1@news2.bit-net.com>, "Quentin Smith"
<macmania@bit-net.com> wrote:

>I need some help with part of a MacPerl script I wrote. The command
>`hostname` returns the current hostname, but how do I get the current IP
>address?

  use Socket;
  print inet_ntoa(inet_aton("www.apple.com"));

Returns:

  17.254.0.91

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch