On Fri, 2 Dec 2016, Stefan Adams wrote:
> I mount M::L apps all the time!
Thanks, that's encouraging!
> Only difference is my apps were never CGI. Not sure if that makes a
> difference?
It shouldn't. And I have problems in daemon mode anyway.
I have a M::L app which runs fine by itself:
root@10:/etc/e-smith/web/functions# ./syslog daemon
Server available at
http://127.0.0.1:3000
^Croot@10:/etc/e-smith/web/functions#
If I try to embed it within a top-level index application, like so:
...
use Mojolicious::Plugin::Mount;
plugin Mount => {'/server-manager/cgi-bin/syslog' => './syslog'};
plugin Mount => {'/server-manager/cgi-bin/systeminformation' => './systeminformation'};
...
Then I get scoping and syntax errors when I try to run it - but not with a
test compile - the line numbers suggest problems with helper declarations:
root@10:/etc/e-smith/web/functions# perl -cw index.mount
index.mount syntax OK
root@10:/etc/e-smith/web/functions# ./index.mount daemon
"my" variable $prop masks earlier declaration in same statement at
/etc/e-smith/web/functions/syslog line 29.
"my" variable $prop masks earlier declaration in same scope at
/etc/e-smith/web/functions/syslog line 33.
"my" variable $prop masks earlier declaration in same statement at
/etc/e-smith/web/functions/syslog line 34.
"my" variable $prop masks earlier declaration in same scope at
/etc/e-smith/web/functions/syslog line 38.
"my" variable $prop masks earlier declaration in same statement at
/etc/e-smith/web/functions/syslog line 39.
"my" variable $prop masks earlier declaration in same scope at
/etc/e-smith/web/functions/syslog line 43.
"my" variable $prop masks earlier declaration in same statement at
/etc/e-smith/web/functions/syslog line 44.
String found where operator expected at /etc/e-smith/web/functions/syslog
line 47, near "get '/'"
(Do you need to predeclare get?)
"my" variable $self masks earlier declaration in same statement at
/etc/e-smith/web/functions/syslog line 50.
String found where operator expected at /etc/e-smith/web/functions/syslog
line 53, near "post '/'"
(Do you need to predeclare post?)
"my" variable $self masks earlier declaration in same scope at
/etc/e-smith/web/functions/syslog line 55.
String found where operator expected at /etc/e-smith/web/functions/syslog
line 94, near "get '/createdest'"
(Do you need to predeclare get?)
"my" variable $self masks earlier declaration in same scope at
/etc/e-smith/web/functions/syslog line 96.
"my" variable $self masks earlier declaration in same statement at
/etc/e-smith/web/functions/syslog line 97.
"my" variable $self masks earlier declaration in same statement at
/etc/e-smith/web/functions/syslog line 97.
"my" variable $self masks earlier declaration in same scope at
/etc/e-smith/web/functions/syslog line 98.
"my" variable $self masks earlier declaration in same statement at
/etc/e-smith/web/functions/syslog line 98.
"my" variable $self masks earlier declaration in same scope at
/etc/e-smith/web/functions/syslog line 99.
"my" variable $self masks earlier declaration in same statement at
/etc/e-smith/web/functions/syslog line 99.
"my" variable $self masks earlier declaration in same scope at
/etc/e-smith/web/functions/syslog line 100.
String found where operator expected at /etc/e-smith/web/functions/syslog
line 103, near "post '/createdest'"
(Do you need to predeclare post?)
"my" variable $self masks earlier declaration in same scope at
/etc/e-smith/web/functions/syslog line 105.
"my" variable $self masks earlier declaration in same statement at
/etc/e-smith/web/functions/syslog line 106.
"my" variable $self masks earlier declaration in same statement at
/etc/e-smith/web/functions/syslog line 106.
"my" variable $prop masks earlier declaration in same scope at
/etc/e-smith/web/functions/syslog line 142.
"my" variable $syslogdb masks earlier declaration in same scope at
/etc/e-smith/web/functions/syslog line 143.
String found where operator expected at /etc/e-smith/web/functions/syslog
line 174, near "get '/remove/:facility/:protocol'"
(Do you need to predeclare get?)
"my" variable $self masks earlier declaration in same scope at
/etc/e-smith/web/functions/syslog line 176.
"my" variable $facility masks earlier declaration in same scope at
/etc/e-smith/web/functions/syslog line 177.
"my" variable $protocol masks earlier declaration in same scope at
/etc/e-smith/web/functions/syslog line 178.
"my" variable $syslogdb masks earlier declaration in same scope at
/etc/e-smith/web/functions/syslog line 180.
"my" variable $destination_host masks earlier declaration in same scope at
/etc/e-smith/web/functions/syslog line 181.
Can't load application from file "/etc/e-smith/web/functions/syslog":
syntax error at /etc/e-smith/web/functions/syslog line 20, near "helper
db"
syntax error at /etc/e-smith/web/functions/syslog line 30, near "}"
syntax error at /etc/e-smith/web/functions/syslog line 35, near "}"
syntax error at /etc/e-smith/web/functions/syslog line 40, near "}"
syntax error at /etc/e-smith/web/functions/syslog line 45, near "}"
syntax error at /etc/e-smith/web/functions/syslog line 51, near "}"
syntax error at /etc/e-smith/web/functions/syslog line 92, near "}"
syntax error at /etc/e-smith/web/functions/syslog line 101, near "}"
syntax error at /etc/e-smith/web/functions/syslog line 172, near "}"
syntax error at /etc/e-smith/web/functions/syslog line 192, near "}"
/etc/e-smith/web/functions/syslog has too many errors.
Compilation failed in require at (eval 78) line 1.
root@10:/etc/e-smith/web/functions#