I sort of think your two options would be great, if I knew how to do either (they might just be my question).

I'm not sure what minimal code I can give you. Hows about:

package Mason::MyDynHandler; sub handler { my($r) = @_; my $output = "%print STDERR $m->session\n alert("foo");"; my $mi = HTML::Mason::Interp->new( #request_class => 'MasonX::Request::WithApacheSession' ); my $c = $mi->make_component(comp_source => $output); $realOutput = $mi->exec($c); print $realOutput; return OK; }

In the above example, I have a $r which is an Apache request. If I include the line "request_class => ...", I will be missing an 'ah' (which I assume is some ApacheHandler class, possibly HTML::Mason::ApacheHandler). If I make an HTML::Mason::ApacheHandler and try to prepare_request, it looks for the path in the request '/somepath/foo.dynjs', which doesn't exist. I would love to know how to use the "existing" interp in this context.

I don't necessarily want to do it this way, I'm just not sure how else to do it (and this doesn't work anyway).

I am configured something like:

<FilesMatch "\.dynjs$"> PerlSetVar Filter On SetHandler perl-script PerlHandler Mason::MyDynHandler PerlSetVar MasonRequestClass MasonX::Request::With +ApacheSession PerlSetVar MasonSessionClass Apache::Session::File </FilesMatch>

I don't know if this clarified anything in my question.


In reply to Re^2: Mason Interp Perl string by SleepyJay
in thread Mason Interp Perl string by SleepyJay

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.