Thanks for all your pointers. I'll see what makes most sense when I get my
hands dirty.

For many reasons, it probably is a good idea to refactor our shared
utilities to take query parameters as arguments somehow instead of
extracting them from $c or global context anyway, so thats my plan for now.

Cheers!

Peter

On Wed, Aug 3, 2016 at 2:39 PM, Ben van Staveren <benvanstave...@gmail.com>
wrote:

> If it's just to get the parameter values,
>
> $app->add_helper('param' => sub { return shift->req->param(shift) })
>
> might do the trick, as long as you pass the controller object to whatever
> expects to be able to use ->param. For a full CGI-compatible mockup, I
> guess you can just create a plugin that creates all the required helpers to
> make that work.
>
> If I have some free time I might just do that...
>
>
>
> On 08/03/2016 02:33 PM, Lee J wrote:
>
> On Tuesday, August 2, 2016 at 4:58:05 PM UTC+2, Joel Berger wrote:
>>
>> Have you tried using https://metacpan.org/pod/Mojolicious::Plugin::CGI I
>> know that Lee Johnson has used it to help port other CGI applications and
>> has put it to video at least once (yes the title card seems to be wrong):
>> https://www.youtube.com/watch?v=dywft_QfGLI
>>
>
> I think the problem here is the half and half approach. M::P::CGI will
> just exec your cgi scripts and return the output once finished, whereas the
> OG poster here wants to emulate CGI->param *within* the mojo app process
> due to the tight coupling of their library code to CGI.pm. I think
> fundamentally you will have problems with any code running CGI.pm under
> Mojolicious (i.e. not exec'd like the plugin) as CGI will do all sorts of
> evil things with STDIN and such. That said, i know there have been changes
> to the plugin recently as the author of some ancient wiki software was
> porting to Mojo and running into the same problems (i forget which
> software, you'll find various PRs and Issues in the M::P::CGI repo on
> github).
>
> The least evil thing (hoho) you can do here is probably create a
> compatibility package as stated. If they're still shared between legacy and
> new code then you're going to have fun, and you probably just want to throw
> that stuff away anyway.
>
> Lee.
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To post to this group, send email to mojolicious@googlegroups.com.
> Visit this group at https://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Mojolicious" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/mojolicious/h5Xau2NP__A/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> mojolicious+unsubscr...@googlegroups.com.
> To post to this group, send email to mojolicious@googlegroups.com.
> Visit this group at https://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to