Hi Dan -

        Try this (not elegant, but works for me):

use strict;
use warnings;

        my $ipcf = `ipconfig`;
        $ipcf || die "ipconfig don't work\n";
        my @ip = $ipcf =~ m/IP Address.*?:\s+(\d+)\.(\d+)\.(\d+)\.(\d+)/;
        (@ip == 4) || die "cant parse ip address from ipconfig\n";
        my $ipaddress = "$ip[0].$ip[1].$ip[2].$ip[3]";
        print "ip address = $ipaddress\n";

Aloha => Beau.

(oh my god, another Cox!)

-----Original Message-----
From: Dan Cox [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 4:51 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: get IP of ppp device


How would I get the IP address that is dynamically assigned to my modem
and assign it to a variable? I'm using windows and would prefer not to
use Win32::Registry. Thanks for any help.

Dan Cox 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to