I wouldn't mind playing around with this problem. Can you dump your testing
code into a gist of multiple files or something?

I'm not likely to solve this problem before you, but I'd be willing to give
it a try!

On Dec 6, 2016 11:19 AM, "Charlie Brady" <[email protected]>
wrote:

>
> On Tue, 6 Dec 2016, Charlie Brady wrote:
>
> > The reason for not using a namespace is that I want to use 'app' to set
> > some defaults. For instance, I want to do these:
> >
> > app->defaults(layout => 'server_manager');
> > app->log->level('warn');
> > push @{app->renderer->paths}, '/etc/e-smith/web/panels/
> manager/templates';
> ...
> > Perhaps I should be defining a 'ServerManager' plugin, and setting the
> > common defaults inside the register() method there.
>
> That doesn't seem to work either:
>
> [root@dsfdsfd functions]# cat My/ML.pm
> package My::ML;
> use Mojolicious::Lite;
>
> plugin 'AppDefault';
>
> 1;
> [root@dsfdsfd functions]# cat Mojolicious/Plugin/AppDefault.pm
> package Mojolicious::Plugin::AppDefault;
> use Mojo::Base 'Mojolicious::Plugin';
>
> sub register {
>   my ($self, $app, $conf) = @_;
>   $app->log->level('warn');
>   push @{$app->renderer->paths},
> '/etc/e-smith/web/panels/manager/templates';
> }
> 1;
> [root@dsfdsfd functions]# perl -I. test.mount
> String found where operator expected at /etc/e-smith/web/functions/one
> line 9, near "get '/'"
>         (Do you need to predeclare get?)
> Can't load application from file "/etc/e-smith/web/functions/one": syntax
> error at /etc/e-smith/web/functions/one line 9, near "get '/'"
> Compilation failed in require at (eval 79) line 1.
> [root@dsfdsfd functions]#
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to