From: Garnier F. <Fra...@ne...> - 2001-06-14 05:41:53
|
Hi Ryan, I know DBI. But I dont want to use it. It's simplier to install only = webmin module without DBI and DBD. I know %ENV too, but I didn't know that it's possible to 'write' in ! Now, I can do what I want. Thanks a lot ! -- CEG - Ville de Neuch=E2tel Francis Garnier Verger-Rond 2 2000 Neuch=E2tel 032/717.81.72 -----Message d'origine----- De : Ryan W. Maple [mailto:ry...@gu...] Envoy=E9 : mercredi, 13 juin 2001 19:53 =C0 : Webmin-devel list (E-mail) Objet : Re: Environment On Wed, 13 Jun 2001, Garnier Francis wrote: > I'm very new to webmin development. I'm trying to do a very simple = module > that access to an Oracle database. > For that, the user who launch the oracle console (sqlplus) must have = some > environment variables. You may want to look at the perl DBI module. It's purpose is to = abstract database accesses into one function. You just tell it what driver to = use (Oracle/MySQL/Postgres) and it does the rest: http://search.cpan.org/doc/TIMB/DBI-1.18/DBI.pm > How can I set environment variable in Webmin ? In perl, there is a hash called %ENV. Run a test perl script: --- SNIP --- #!/usr/bin/perl foreach my $k (sort keys %ENV) { print "$k =3D $ENV{$k}\n"; } --- SNIP --- All you need to do (to define new envars) is put new elements into the hash by doing "$ENV{'oracle_var'} =3D 'value';". These variables are inherited to sub-processes, so if it's any sort of authentication token = be careful. We learned this the hard way recently: http://www.linuxsecurity.com/advisories/o ther_advisory-1404.html Hope this helps, Ryan --=20 +-- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- = --+ Ryan W. Maple "Finality is A Good Thing." -- Dave Wreski Guardian Digital, Inc. ry...@gu... +-- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- = --+ - Forwarded by the Webmin development list at web...@we... To remove yourself from this list, go to http://lists.sourceforge.net/lists/listinfo/webadmin-devel |