[cgiapp] CAD::Server strangeness

George Hartzell hartzell at alerce.com
Sun Sep 14 12:37:43 EDT 2008


You needed to fix up your dispatch class because once the other bugs
get/got fixed your app won't work any more.  Your new class looks like
it'll do the right thing, although you ignore any arguments that might
get passed in.  Since it's your class and you know how it'll get used,
ignoring the arg's rates a "whatever...".  From a defensive coding
point of view I find your use of $args and %args with different scopes
in the same function to be a bit confusing, I know myself well enough
to know that I'd trip over it eventually...

I used the word "intelligent" because I was trying to avoid declaring
a "right" and "wrong".  There's an issue of precedence among the super
class's defaults, your defaults, and the args.  Should the super
class's values take priority, or your defaults, or the values that
might be passed in as arguments to dispatch_args.  As long as all of
the important bits of the hash are there the particular priorities are
a policy issue....

Your duplication bug won't go away until CAD::Server.pm gets patched
up.  You can fix your copy by hand, the patch that I described Works
Well For Me, and hopefully at some point it'll get pushed up and out
(I'm happy to help).

You could also switch over to CGI::Application::Server, but I'm pretty
sure it's broken with respect to CGI::Application::Dispatch too, I
posted a note with my observations and a fix yesterday.

Thanks for pointing all this out, it was fun to dig in and figure out
what was up.

g.


More information about the cgiapp mailing list