[dancer-users] how should I set a setting while parsing command line options (GH#393)

Slavik Goltser slavikg at gmail.com
Wed Oct 9 13:49:29 BST 2013

I think that using ENV to set options is not a bad idea, since they can be
retrieved if needed (/proc/PID/environ) and keep the command line down. One
of the popular methods in java land is to export the classpath as an
environment variable (otherwise command lines get unbearably long).

On Mon, Oct 7, 2013 at 8:05 AM, sawyer x <xsawyerx at gmail.com> wrote:

> That really is a tricky point... I'm not exactly sure, to be honest.
> On Tue, Sep 17, 2013 at 11:28 PM, Gideon D'souza <gidisrael at gmail.com>wrote:
>> Hey folks,
>> So I'm working on fixing issue #393:
>> https://github.com/PerlDancer/Dancer2/issues/393
>> I'm sorry to have gotten jammed up with such a simple task. I ran into a
>> small issue which might relate to other things going on.
>> (1) I cannot use setting(port => 1234) or setting(environment => "stage")
>> inside GetOpt like Dancer1. It fails.
>> Here is the line that fails:
>> https://github.com/gideondsouza/Dancer2/blob/pr/command_line_support/lib/Dancer2/GetOpt.pm#L15
>> @mst did point out this is incorrect, I should point to the config
>> setting on the app instance. A larger problem here is that this doesn't
>> work either.
>> (2) $app->setting(..) or $runner->setting(..) don't work.
>> See :
>> https://github.com/gideondsouza/Dancer2/blob/pr/command_line_support/lib/Dancer2.pm#L151
>> What also perplexed me is that if I put a breakpoint at a line inside
>> Dancer2::import it wouldn't stop and just go and run the server.
>> So what should I do here?  Setting $ENV{} works. Should I do this? Am I
>> doing something wrong? Is there anything else I should fix first?
>> Regards,
>> Gideon
>> _______________________________________________
>> dancer-users mailing list
>> dancer-users at dancer.pm
>> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
> _______________________________________________
> dancer-users mailing list
> dancer-users at dancer.pm
> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20131009/33d95df6/attachment.html>

More information about the dancer-users mailing list