atemerev has asked for the wisdom of the Perl Monks concerning the following question:

Hello monks,

I'm curently writing our Boring Corporate Site in HTML::Mason over mod_perl2. With some effort, I've set up a "session" scope variable controlled by cookies (thanks to Apache::Session::Wrapper). But now I need a "request" scope variable which would survive redirects, but not rest on the entire session. For example, I'd like to put error message in request scope, then do a HTTP redirect to my error page, extract the error message and complete the requests (all other ways are uglier). How can I do that? Is there something for that in $m or $r?

Replies are listed 'Best First'.
Re: mod_perl2 / HTML::Mason request scope.
by perrin (Chancellor) on Apr 03, 2008 at 19:33 UTC
    Either put it in your session and delete if after you've read it, or put it in the URL you're redirecting to as a query arg.
      I'm putting everything in URL right now, and it works, except the URL is ugly. I don't like ugly things, so I'm looking for a better way. :)
        If you don't want to use the URL, you have to put it in the session.