...I am familiar with code constructs that bend a little backward to satisfy Lint, or some other code cleanliness mechanism. And I've done my own bending w/r to Perl when I need to be sure that either -w, or strict, or require demand that code be laid out in a certain fashion.
But I'm having a little trouble seeing why the following code (from DBD::mysql test suite) is necessary:
my $host = shift @ARGV || $ENV{'DBI_HOST'}
|| $::test_host || $::test_host; # Make -w happy
I'm okay with the concept that $host will be set to the first appropriate value from the subsequent list of logical alternatives. I just don't get why the second reference to $::test_host. And for that matter, I'm not sure why $::test_host instead of $test_host. I presume that we're operating in the Main package here, so in either case we're talking about the same variable.
What have I missed?