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

Re: [MacPerl] IP number



At 23.19 +0200 2000.03.29, imike wrote:
>How can my MacPerl script get my IP number ?

  use Socket;
  chomp(my $host = `hostname`);   # get hostname (could be IP address, if no
                                  # hostname for your machine)
  print my $ip = inet_ntoa inet_aton $host;  # convert to IP address

-- 
Chris Nandor       |     pudge@pobox.com      |     http://pudge.net/
Andover.Net        | chris.nandor@andover.net | http://slashcode.com/

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org