Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

Include a local configuration file

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


orasnita at gmail

Nov 8, 2009, 7:41 AM

Post #1 of 2 (738 views)
Permalink
Include a local configuration file

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?

Thank you.

Octavian


_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


jshirley at gmail

Nov 8, 2009, 11:45 AM

Post #2 of 2 (628 views)
Permalink
Re: Include a local configuration file [In reply to]

2009/11/8 Octavian Râşniţă <orasnita [at] gmail>

> 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

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.