perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Peng <yhp...@orange.fr>
Subject About config file
Date Thu, 07 Mar 2013 03:00:37 GMT
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 $conf = Myconfig->new;
my $opt1 = $conf->{key1};
my $opt2 = $conf->{key2};
...


I don't know if this is a good way. Do you have suggestions?

Thanks.

Mime
View raw message