Search code examples
perlcgidreamhostmason

How to get QUERY_STRING in perl mason CGIHandler?


I need to do some maintenance on a Mason site that was working well at one hosting company, but needs to be moved to another. The new hosting company doesn't support ApacheHandler, so I'm changing the code to CGIHandler.

Unfortunately, I no longer get the QUERY_STRING elements populated into the mason environment, which makes it a little hard!

I got the bulk of the handler code from here: http://joe.pepersack.net/code/site-mason_handler.pl

The handler is being setup like this:

$h = HTML::Mason::CGIHandler->new(
  comp_root     => $mason_root,
  data_dir      => $mason_data,
  allow_globals => $::MASON_GLOBALS,
  error_mode    => "output",
  default_escape_flags => "h"
);

A general search of the internet doesn't return me anything good...

Does anyone know if there's a difference in parameter passing between ApacheHandler and CGIHandler? If they're being eaten somewhere else, how can I test whether CGIHandler found the params in the first place?

Any help (or additional leading questions) would be most appreciated. This site is for a youth fund-raiser, so there's not much time/support for rewriting it at the moment.


Solution

  • Thanks for the debugging help. Based on your ideas, I determined that $ENV{QUERY_STRING} wasn't available to mason, which made me go back and check apache. Sure enough, there was a rewrite rule that didn't have [QSA], so it was eating the query string.