Here's the script:
#!/usr/bin/perl
use strict;
++$a{$x};
and when run, produces, Global symbol "%a" requires explicit package name at ./test3.pl line 4.
Global symbol "$x" requires explicit package name at ./test3.pl line 4.
So, I'm not sure if I see that point. Are you not a fan of autovivification? Because it: rules. I think the only thing one has to understand is the use of exists(), to see if there is, say, a key in a hash, rather than defined(): #!/usr/bin/perl
use strict;
my %foo = (batz => undef);
for (qw(bar batz)){
if(exists($foo{$_})){
print "$_ exists!\n";
if(defined($foo{$_})){
print "and $_ is defined.\n";
}
else {
print "and $_ is undefined.\n";
}
}
else {
print "$_ doesn't actually exist\n";
}
}
prints, bar doesn't actually exist
batz exists!
and batz is undefined.