6 May
2002
6 May
'02
20:27
Hallo, On Mon, 06 May 2002, Thomas Schürmann wrote:
my $remoteip = ""; $remoteip = system(....); print $remoteip ."\n";
==== #!/usr/local/bin/perl -w use strict; my (@ifconfigout, $localip, $remoteip); my $iface = "ppp0"; # bitte anpassen, bei ippp* und eth* ggfs. die REs @ifconfigout = split('\n',`/sbin/ifconfig $iface`); ( $localip = $ifconfigout[1] ) =~ s/.*addr:([0-9\.]+).*/$1/m; ( $remoteip = $ifconfigout[1] ) =~ s/.*P-t-P:([0-9\.]+).*/$1/m; print "$localip\n$remoteip\n"; ==== -dnh -- When computers emit smoke, it means they've chosen a new Pope. Unfortunately, they invariably choose the wrong one and immediately get condemned to nonfunctionality for heresy. [Anthony DeBoer in the SDM]