Maybe I should use ''PerlSetVar''. I will think it. > -----ԭʼ�ʼ�----- > ������: Mike & Christine [mailto:[EMAIL PROTECTED]] > ����ʱ��: 2001��6��6�� 11:49 > �ռ���: Wang Xingyu ������ [�Ϻ�]; [EMAIL PROTECTED] > ����: Re: ��: In module require configuration file > > > and also http:// > thingy.kcilink.com/modperlguide/perl/Using_Non_Hardcoded_Confi > guratio.html > ----- Original Message ----- > From: Wang Xingyu ������ [�Ϻ�] <[EMAIL PROTECTED]> > To: Wang Xingyu ������ [�Ϻ�] <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Tuesday, June 05, 2001 9:15 PM > Subject: ��: In module require configuration file > > > > Sorry.I find ,require different configuration file in module is > > impossibility. > > Have a mistake ,my mandrake box run in cgi environment as > a result of > > apache configure. > > > > So ,in mod-perl,I dont find any way require different configuration. > > > > > -----?-��?����?t----- > > > ����?t��?: Wang Xingyu ��?D?��? [��?o��] > > > ����?������??: 2001?��6??5��? 15:22 > > > ��??t��?: [EMAIL PROTECTED] > > > ?�¨�a: In module require configuration file > > > > > > > > > Hi all: > > > > > > In mod-perl,my module (mymodule.pm) will read > config var from a > > > file ( require conf.pm).I put the require in my new() function. > > > In one instance,they will work well. > > > But ,I will run two or more instance (the two conf.pm is > > > different.),the mymodule.pm will have error.Because it > > > require conf.pm > > > and maybe get other conf.pm. > > > I am test false in redhat 7,the apache is 1.3.14 and > > > mod-perl is > > > 1.24. And re-compile apache 1.3.20 and mod-perl 1.25,and > test false > > > also. > > > > > > But I am test in Mandrake 8 ,the apache is 1.3.19 and > > > mod-perl is > > > 1.25.The two instance has worked! > > > > > > I wonder,why redhat un-support two instance and > > > Mandrake is well? > > > > > > Thanks and sorry for my english. > > > > > > > > > The sample code: > > > > > > ========================================================= > > > #!/usr/bin/perl > > > # mymodule.pm > > > > > > Package mymodule; > > > > > > sub new > > > { > > > my $type = shift; > > > my $self = {}; > > > require "./conf.pm"; > > > bless $self,$type; > > > } > > > > > > ========================================================= > > > #!/usr/bin/perl > > > # conf.pm > > > # configuration file one > > > package conf; > > > use strict; > > > use vars qw($conf); > > > > > > # defined configure variable > > > $conf = > > > { > > > # web name. > > > 'web_name' => 'foo.com', > > > } > > > > > > > > > > > > ======================================================== > > > #!/usr/bin/perl > > > # conf.pm > > > # configuration file two > > > package conf; > > > use strict; > > > use vars qw($conf); > > > > > > # defined configure variable > > > $conf = > > > { > > > # web name. > > > 'web_name' => 'foo.com', > > > } > > > > > > ========================================================= > > > #!/usr/bin/perl > > > # mycgi.pl > > > use mymodule; > > > my $m = mymodule->new(); > > > print $conf::conf->{'web_name'}; > > > > > > > > > ========================================================== > > > > > > >
