in reply to Environmental Settings

When you shell out of Perl, the environment is set using the %ENV hash. You can alter this hash within your script, and then each shell call will use your altered %ENV. When the script ends, the environment will revert to whatever it was before your script. (unless you edit it some other way.)
So instead of calling your init routine, write it into your perl script.

Replies are listed 'Best First'.
RE: RE: Environmental Settings
by BBQ (Curate) on Apr 28, 2000 at 07:57 UTC
    Well noted! Same as CGI... Those who use the Oracle DBD driver have found that it won't fly unless you set the Oracle ENVs correctly. A common example of this is printing out the %ENV hash on test.pl's:
    print "Content-type: text/plain\n\n"; foreach (keys %ENV) { print "\$ENV{$_}\t$ENV{$_}\n"; }
    (some of these however should be respected as read-only...)

    cheers!
RE: RE: Environmental Settings
by Jonathan (Curate) on Apr 28, 2000 at 13:00 UTC
    I think the problem is that system will create a sub-shell therefore any environment variables defined will be out of scope to the calling process, what you really want is a perl version of the C function 'putenv'(btrott and chromatic will make me a liar by saying one exists already :-) Adding to the ENV hash seems the best way to go.