[cgiapp] Possible patches for ::Server (was: Re: ::Server vs ::Dispatch::Server: Worth having both?)

George Hartzell hartzell at alerce.com
Sat Sep 20 17:08:59 EDT 2008


Mark Stosberg writes:
 > 
 > > Patches welcome.
 > 
 > I'd like to provide feedback on various proposed changes to CGI::Application::Server
 > 
 > > Need a way to specify parameters to dispatch()
 > 
 > I disagree. The recommended way to do this to define a 'dispatch_args'
 > routine in your CGI::Application::Dispatch subclass. I think George
 > discovered seperately that the "dispatch_args()" method in
 > ::Dispatch::Server was too magical for it's own good. 
 > [...]

Well, in the defense of ::Dispatch::Server's dispatch_args() method,
it was tripping over a sharp edge in ::Dispatch::dispatch, where the
specialized handling of args_to_new->{TMPL_PATH} blindly concatenates
the existing list of directories with the existing list without
checking for duplicates.

I'm not sure what the Right Thing To Do there might actually be (I'm
not a TMPL_PATH user), but given that the rest of the merging replaces
existing values with newer values the behaviour is Surprising.

Passing arguments to ::Dispatch::dispatch gets pretty prominent
billing in the ::Dispatch documentation, so it's not surprising that
folks use it.

g.


More information about the cgiapp mailing list