jaldama has asked for the wisdom of the Perl Monks concerning the following question:
Just using warnings, I get this
Undefined subroutine &main::inet_aton called at dnscheck.pl line 15.
When I add in use strict; I get
This is the code so far:Global symbol "%dns_check" requires explicit package name at dnscheck. +pl line 7. Global symbol "$key" requires explicit package name at dnscheck.pl lin +e 13. Global symbol "$value" requires explicit package name at dnscheck.pl l +ine 13. Global symbol "%dns_check" requires explicit package name at dnscheck. +pl line 13. Global symbol "$key" requires explicit package name at dnscheck.pl lin +e 14. Global symbol "$key" requires explicit package name at dnscheck.pl lin +e 15.
- Confused%dns_check = ("address" => "ip"); while ( ($key, $value) = each %dns_check) { $found_addr = gethostbyname($key) or die "Error $!\n"; $found_addr = inet_ntoa(inet_aton($key)); print "IP found is: $found_addr ", "\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Undefined Subroutine & Global symbol requires explicit package name
by Corion (Patriarch) on Jan 24, 2012 at 15:29 UTC | |
Re: Undefined Subroutine & Global symbol requires explicit package name
by rovf (Priest) on Jan 24, 2012 at 15:31 UTC | |
Re: Undefined Subroutine & Global symbol requires explicit package name
by rovf (Priest) on Jan 24, 2012 at 15:35 UTC | |
by jaldama (Acolyte) on Jan 24, 2012 at 16:27 UTC | |
by tobyink (Canon) on Jan 24, 2012 at 16:48 UTC | |
by lune (Pilgrim) on Jan 24, 2012 at 18:31 UTC | |
Re: Undefined Subroutine & Global symbol requires explicit package name
by Anonymous Monk on Jan 24, 2012 at 15:32 UTC |
Back to
Seekers of Perl Wisdom