Re: About config file

Eduardo Arino de la Rubia <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <CABuA6KBE=UTqjPbLTpoXX_9A3uP-yXk+FRdz5QyX5v7gDQ0p=A@mail.gmail.com>
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 <[email protected]> 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 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.
>



-- 
int getRandomNumber() {
    return 4; // Chosen by dice throw.
                    // guaranteed to be random...
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.