About config file

2013-03-06 Thread Ken Peng
Hello, How do you setup config file in modperl web development? I currently use the style like a package: package Myconfig; sub new { my $class = shift; my $option = { key1 => 'foo', key2 => 'bar', ... }; bless $option,$class; } 1; Then in the modperl program: use Myconfig; my

Re: About config file

2013-03-06 Thread Eduardo Arino de la Rubia
Greetings! For relatively simple needs, check this out: http://modperlbook.org/html/4-2-11-PerlSetVar-and-PerlAddVar.html Cheers! On Wed, Mar 6, 2013 at 7:00 PM, Ken Peng wrote: > Hello, > > How do you setup config file in modperl web development? > I currently use the style like a package:

Re: About config file

2013-03-06 Thread Jie Gao
Hi Ken You can follow this: http://perl.apache.org/docs/2.0/devel/core/coding_style.html if you are after a standard coding style. Regards, Jie * Ken Peng wrote: > Date: Thu, 7 Mar 2013 11:00:37 +0800 > From: Ken Peng > To: modperl@perl.apache.org > Subject: About config

Re: About config file

2013-03-06 Thread Ken Peng
于 2013-3-7 11:07, Eduardo Arino de la Rubia 写道: For relatively simple needs, check this out: http://modperlbook.org/html/4-2-11-PerlSetVar-and-PerlAddVar.html Cheers! Thanks. But my config file is a complicated data stru, it's a multi-level hash, more likely the JSON.

Re: About config file

2013-03-06 Thread Ken Peng
于 2013-3-7 11:15, Jie Gao 写道: You can follow this: http://perl.apache.org/docs/2.0/devel/core/coding_style.html if you are after a standard coding style. Regards, Thanks. but I don't think it's something about coding style.

Re: About config file

2013-03-06 Thread Jon
Is there any reason he can't use Config::Any? http://search.cpan.org/~bricas/Config-Any-0.23/lib/Config/Any.pm Then he can load his json structures directly (via .json file) or load variables from a .pl file. Maybe I've missed the scope of the problem, but op's example immediately made me think h

Re: About config file

2013-03-07 Thread Andy Colson
On 3/6/2013 9:00 PM, Ken Peng wrote: Hello, How do you setup config file in modperl web development? I currently use the style like a package: package Myconfig; sub new { my $class = shift; my $option = { key1 => 'foo', key2 => 'bar', ... }; bless $option,$class; } 1; Then in

Re: About config file

2013-03-07 Thread Adam Prime
On 03/06/2013 11:21 PM, Jon wrote: > > Is there any reason he can't use Config::Any? > http://search.cpan.org/~bricas/Config-Any-0.23/lib/Config/Any.pm > > > There's no reason why he can't use any Config package, or roll his own

Re: About config file

2013-03-07 Thread Anton Petrusevich
On Thursday 07 March 2013 11:00:37 Ken Peng wrote: > Hello, > > How do you setup config file in modperl web development? > I currently use the style like a package: > ... > I don't know if this is a good way. Do you have suggestions? I am not an expert here, but I think it's acceptable way. YAML

Re: About config file

2013-03-08 Thread Randolf Richardson
> On Thursday 07 March 2013 11:00:37 Ken Peng wrote: > > Hello, > > > > How do you setup config file in modperl web development? > > I currently use the style like a package: > > ... > > I don't know if this is a good way. Do you have suggestions? > > I am not an expert here, but I think it's acc