From: Ryan W. M. <ry...@gu...> - 2001-06-13 17:52:35
|
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 = $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'} = '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/other_advisory-1404.html Hope this helps, Ryan -- +-- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --+ Ryan W. Maple "Finality is A Good Thing." -- Dave Wreski Guardian Digital, Inc. ry...@gu... +-- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --+ |