From: Jay L. <Ja...@re...> - 2000-04-25 12:49:56
|
How about this? (of course, change eth0 if needed) jay #!/usr/bin/perl $if=`/sbin/ifconfig eth0`; $if =~ /inet addr:(.*) Bcast/sg; $ip = $1; print "ip: $ip\n"; -----Original Message----- From: John Edmonds [mailto:pe...@kc...] Sent: Tuesday, April 25, 2000 12:14 AM To: mis...@li... Subject: [misterhouse-users] IP Address Does anyone know of a way to get the IP address of a linux machine via Perl? I am using DHCP on a cable network and want to send my IP address to my PCS phone on starting Mr. House. I have tried to use 'gethostent' and 'getnetent' functions, but they don't seem to work. Any suggestions? john ________________________________________________________ To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365 |