Hi Charles,
> Hm, If you can't set oraenv directly at runtime, delaying the
> import will still work.
>
> require Env::Sourced;
>
> ... # determine version, etc.
>
> Env::Sourced->import( qw{first/file/to/include.sh /second/file/to/
> include.sh} );
Exactly. This is just what I posted in my original mail:
*** 1st mail START ***
> Maybe one of you has a clue why I get a false error message when using
> Env::Sourced. My (test-)script is as follows:
>
> #!/usr/bin/perl -w
> use strict;
> use warnings;
> require Env::Sourced; # "require" necessary in main programme, just
not
> changed for testing
>
> my $w_conf = $ENV{'W_UMG_CONFIG_PFAD'};
> my $oraenv;
> my $orapat = '9208';
>
> print "Environment BEFORE:\n", `env |grep ORA`, "\n";
>
> if ( $orapat ne 'D' ) {
> $oraenv = "$w_conf/ora$orapat.env"; # coalesce path + filename
> print "OraEnv: $oraenv\n"; # check absolute file name
> Env::Sourced->import($oraenv) or warn "Fehler beim Setzen des
> Oracle-Environments: $!\n"; # set environment
> }
>
> print "\nEnvironment AFTER:\n", `env |grep ORA`, "\n";
>
>
> BUT I get the following output:
>
> oracle:/opt/data/magna/wartung/work/nora>./test.pl
> Environment BEFORE:
> ORACLE_BASE=/opt/app/oracle
> ORACLE_SID=
> ORA_NLS=/opt/app/oracle/product/9.2/ocommon/nls/admin/data
> ORACLE_TERM=vt220
> ORA_NLS32=/opt/app/oracle/product/9.2/ocommon/nls/admin/data
> ORA_NLS33=/opt/app/oracle/product/9.2/ocommon/nls/admin/data
> ORADATA=/opt/app/oracle/oradata1
> ORACLE_HOME=/opt/app/oracle/product/9.2
>
> OraEnv: /opt/data/magna/umgebungen/config/ora9208.env
> Fehler beim Setzen des Oracle-Environments:
>
> Environment AFTER:
> ORACLE_BASE=/opt/app/oracle
> ORACLE_SID=
> ORA_NLS=/opt/app/oracle/product/9.2.0.8/ocommon/nls/admin/data
> ORACLE_TERM=vt220
> ORA_NLS32=/opt/app/oracle/product/9.2.0.8/ocommon/nls/admin/data
> ORA_NLS33=/opt/app/oracle/product/9.2.0.8/ocommon/nls/admin/data
> ORADATA=/opt/app/oracle/oradata1
> ORACLE_HOME=/opt/app/oracle/product/9.2.0.8
>
> The absolut path to the environment file is ok, and judging from the
> "Environment AFTER" output it is also being read/sourced, nevertheless
> I get the warning that there was an error when sourcing the file (and
> even an incomplete one, it does not give me the $!). Anybody got an
> idea?
*** 1st mail END ***
--> My problem is not _how to do it_ but _why I get an error_ although
the import does obviously work, judging from the correctly set
variables.
Kind regards,
Nora
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/