CGI::Emulate::PSGI
wasn't working, because I did not reset CGI
's global variables.Here is the correct way to do it:
1 use CGI::Emulate::PSGI; 2 use CGI; 3 4 my $app = CGI::Emulate::PSGI->handler(sub { 5 CGI::initialize_globals(); 6 do "perldocweb"; 7 })
This is already in the documentation for CGI::Emulate::PSGI, and it's been there as long as the code's been on CPAN.
ReplyDeleteSo, yeah, if you don't do what the docs say, your code doesn't work.
The docs also (as of yesterday) link to CGI::Compile, which takes care of this for you.
You're right, I edited the post to show that it was my mistake.
ReplyDelete