Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The output keeps coming back with "no" even though I put in a valid ip address. It should give me back the name to the server. Why cant I pass the $addy variable in the argument. Please help me fix this.use Socket; use strict; my $addy = shift || die "Enter a IP address"; my $client = gethostbyaddr($addy, AF_INET); # get name if ($client) { print $client, "\n\a"; } else { print "no\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: variable not passing
by gaal (Parson) on Dec 07, 2004 at 18:31 UTC | |
by Anonymous Monk on Dec 07, 2004 at 18:51 UTC | |
by gaal (Parson) on Dec 07, 2004 at 19:05 UTC | |
by Anonymous Monk on Dec 08, 2004 at 10:56 UTC | |
|
Re: variable not passing
by Eimi Metamorphoumai (Deacon) on Dec 07, 2004 at 19:01 UTC |