
jshirley at gmail
Nov 8, 2009, 11:45 AM
Post #2 of 2
(183 views)
Permalink
|
2009/11/8 Octavian Râşniţă <orasnita[at]gmail.com> > Hello, > > I want to include a configuration file (for generating a menu) in a > separate file, not in myapp.pl nor myapp_local.pl. > > That file (menu.pl) also contains a perl hashref inside. > > I have included this file using the following line in myapp.pl and it > works under Windows: > > menu => do('menu.pl'), > > but it doesn't work under Linux. > > Under Linux I have tried: > > menu => do("__path_to(menu.pl)__"), > > but it doesn't want to work this way. > > It does want to work if I use: > > menu => do('/srv/MyApp/menu.pl'), > > and I can put this configuration in myapp_local.pl, but... is there a way > of specifying the path to the home directory in order to not need using > myapp_local.pl? > > You can't just magically put "__path_to(...)__" in any string and expect it to work. That's something Catalyst::Plugin::ConfigLoader does. If you want it in code, use MyApp->path_to. -J
|