Mark Torrance mark-at-vinq.com |mason mailing list| wrote:
> I see; you want the cgi program to be executed on the server to render 
> that content.  You're right -- there's no simple way in Mason to ask 
> apache to serve + process that file.
>
> I see 2 possible solutions.  If the cgi program is written in Perl, 
> and you don't mind "porting" it to run under Mason, you could take the 
> guts of it and put them in the %init section of a new Mason component, 
> and then just call that component.  This is the most "masonesque" 
> choice, and probably the one I would choose unless there was a real 
> issue of maintaining the legacy cgi-bin version for some reason.
>
I was considering that, at least eventually.  But I don't even know how 
the script "flows" now, where the parameters are coming from and what 
the state is, etc.  It relies on CGI.pm taking care of $config and I 
don't even know what's supposed to be in it.  The Apache log doesn't 
show the contents of the POST body, and I'm not expert in that type of 
development.



> If on the other hand you really just want to call the cgi program 
> through the web server, as if you were an end-user client, and then 
> incorporate the results into your page, you could write a component 
> like this:
>
> <%init>
> use LWP::Simple;
> my $content = get("http://localhost/cgi-bin/mything";);
> </%init>
> <% $content %>
>
Thanks for showing me the details.  That ought to work as a work-around, 
and also to encapsulate the component to isolate further work on it.

But I'm wondering if the layers that Mason is built on -- some Perl 
Apache modules and ModPerl and an installed "Handler" -- has a call that 
will do a "get" more directly.  Can someone here point me in that 
direction?  Learning the whole lower-level systems in detail is not part 
of the Q&D side project.


BTW, what I'm doing is using Dan Ragle's "Simple Comments" 
(<http://www.webreference.com/programming/perl/comments/index.html>).  
If you knew of something better and more Mason-ready...?

After I get his stuff working as-is, I want to play around with making 
the main page cache correctly, and serve the changing comment info 
separatly somehow.  Mason is good at controlling the caching.

--John



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to