Re: get IP of ppp device

2002-10-08 Thread david
Dan Cox wrote: > 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 check out IO::Socket and IO::Interface. example: #!/usr/bin/perl -w use stri

RE: get IP of ppp device

2002-10-07 Thread nkuipers
> 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"; It seems like you are breaking up the ip only to put it ba

RE: get IP of ppp device

2002-10-07 Thread Beau E. Cox
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 ipcon