wfsp has asked for the wisdom of the Perl Monks concerning the following question:
I'm quite happy with this (it does the job) but it doesn't seem very elegant. Any suggestions?
Thanks in advance.
#!/bin/perl5 use strict; use warnings; use Win32::Internet; use Socket; use Sys::Hostname; my $INET = new Win32::Internet() or die qq(Cannot connect to Internet); my @error = $INET->Error; print "@error\n"; my $URL; $INET->OpenURL($URL, "http://www.yahoo.com/"); my $host = hostname(); my $addr = inet_ntoa(scalar gethostbyname($host || 'localhost')); print "$addr\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Launching a dialup connection with Win32::Internet
by ccn (Vicar) on Jul 28, 2004 at 11:38 UTC | |
by wfsp (Abbot) on Jul 28, 2004 at 15:41 UTC | |
|
Re: Launching a dialup connection with Win32::Internet
by kral (Monk) on Jul 28, 2004 at 16:05 UTC | |
by wfsp (Abbot) on Jul 28, 2004 at 16:35 UTC | |
by kral (Monk) on Jul 28, 2004 at 19:17 UTC |