in reply to Undefined Subroutine & Global symbol requires explicit package name

I do not know what you used to learn Perl, but clearly it's a bad resource/teacher if you already confused by this very basic problem. See http://learn.perl.org/ and http://perl-tutorial.org/ to find good ones.

You need to declare variables you use with the my function.

use strict; use warnings FATAL => 'all'; my %dns_check = (address => 'ip'); while (my ($key, $value) = each %dns_check) { my $found_addr = gethostbyname($key) or die "Error $!\n"; $found_addr = inet_ntoa(inet_aton($key)); print "IP found is: $found_addr\n"; }
  • Comment on Re: Undefined Subroutine & Global symbol requires explicit package name
  • Download Code