chantstophacking has asked for the wisdom of the Perl Monks concerning the following question:
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Making -w happy
by Corion (Patriarch) on Mar 03, 2003 at 16:37 UTC | |
by chantstophacking (Acolyte) on Mar 03, 2003 at 16:47 UTC |