I have encountered what I consider a bug in the 'param' method of Apache::Request in mod_perl 1. The method returns a list of parameters, or a '0' if no parameters are found. This makes the following code create a bogus param entry:

%input = map {$_ => join("\t", $apr->param($_))} $apr->param;

I have worked around it by:

  my @params = $apr->param;
  if( scalar @params > 1 || $params[0] ) {
    %input = map {$_ => join("\t", $apr->param($_))} @params;
  } else {
    %input = ();
  }

but that seems... klunky.  The documentation does not specify what
the actual return should be in the case where there are no parameters,
but it seems to me that an empty list would be more appropriate than a '0'.


-- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html



Reply via email to