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
于 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.
于 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.
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 file
> User-A
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:
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