All the Perl that's Practical to Extract and Report

Navigation

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Without JavaScript enabled, you might want to
use the classic discussion system instead. If you login, you can remember this preference.

Please Log In to Continue

use Mason's templating parts, not its web framework parts, like you would with Catalyst or Jifty. see the source of Catalyst::View::Mason, and the "using Mason in standalone scripts" part of HTML::Mason::Admin.

(I'll be damned if I can get the code to format within <code> tags, so this is all Code format.)I actually tried installing Jifty last night because I realized it might be more what I had in mind (continuations, Mason...), but I aborted the install after about a half hour of exciting CPAN action. (Maybe I should try Catalyst I guess, but it's never really felt right to me..)

Then I ended up doing just what you mentioned, using Mason as a standalone script. It wasn't very elegant, though. Unfortunately

Yeah. In larger apps I usually end up putting $request into an instance variable so that I don't have to pass it around all the time. You can do the same thing with your Mason interpreter, I imagine your main body might look like:sub main { my $request = shift; my $app = App->new(request => $request); $app->run;}