[cgiapp] CGI::Simple as replacement for CGI not working?

Richard Jones ra.jones at dpw.clara.co.uk
Thu Nov 19 05:19:42 EST 2009


Richard Jones wrote:
> App working fine with default CGI, but decided to see if it works with 
> CGI::Simple using the cgiapp_get_query() override. But instead of 
> rendering the page I get a popup: 'you have chosen to open 
> myapp_server.pl which is a Perl script ... what should Firefox do with 
> this file'. I can't fathom where the problem lies. Anyone been there before?

OK, more info. The app does actually work OK with CGI::Simple, but I'm 
using the expression $self->query->url() a lot to generate links within 
the app, and when I dump $self->query->url() to stdout, for CGI::Simple 
I get this: http://localhost:8080script/lims_server.pl
instead of the correct url (as with CGI.pm): http://localhost:8080/hmds

That appears to be what is causing the problem. If I hover over the urls 
generated by the app using CGI::Simple, I get things like 
http://localhost:8080/lims_server.pl/user/change_password
and if I change 'lims_server.pl' to 'hmds' (as generated by CGI.pm) in 
the browser address, the page renders fine (but still generates 
incorrectly formatted urls).

lims_server.pl is the name of the script which starts the development 
server on port 8080.

my $server = CGI::Application::Server->new();
$server->document_root("$Bin/../static");
$server->entry_points( { '/hmds' => 'LIMS::Dispatch' } ); # CAD class
$server->run;

Hope this is more helpful.
-- 
Richard Jones


More information about the cgiapp mailing list