Is this use of defined @array in CGI.pm deliberate?
# if we get called more than once, we want to initialize
# ourselves from the original query (which may be gone
# if it was read from STDIN originally.)
if (defined(@QUERY_PARAM) && !defined($initializer)) {
for my $name (@QUERY_PARAM) {
my $val = $QUERY_PARAM{$name}; # always an arrayref;
As in, is it relying on the difference in behaviour between
scalar @QUERY_PARAM;
and
undef @QUERY_PARAM;
for the case of
@QUERY_PARAM = 'Element';
@QUERY_PARAM = ();
? If so, no comments suggest that this is the intent, and no tests fail if I
change it to remove the defined.
defined @array has been marked as deprecated for aeons, but doesn't (currently)
warn for package variables.
I'd like to change things so that all deprecated features warn, but doing that
in blead right now would make this (and Module::Pluggable, patch sent) issue
warnings.
Nicholas Clark
Thread Next