cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

environment variables...

JasonBuss
1-Newbie

environment variables...

I am trying to grab the value of an environment variable (one set by
another application) in an ACL script placed in the init directory.
However, it keeps telling me that the $ENV["MY_VAR"] package doesn't
exist. Is $main the last package to load? Is it loading after the init
directory is read?



Thanks,



-Jason

2 REPLIES 2

ENV array is accessible through main package.

$main::ENV["MY_VAR"] should work.

Init directory scripts are loaded after main package.

Cf. help on custom directory structure :
The initsubdirectory is processed last at startup time. All files of the supported
application types are executed. No nested subdirectories of custom\init are supported. This directory is
processed after the other Arbortext-path\custom subdirectories so that its scripts and
applications can rely on paths already established during startup.
If you are putting custom applications on an Arbortext
Publishing Engine server, use the init directory for your custom .acl, .js, .class files.
In the startup process, thecustom\initdirectory is processed after _main.acl but before the arbortext.wcf (Windows) or .arbortext.wcf (UNIX) file. See Startup command
files for complete startup processing information.

Regards,
Gilles Beaugeais.


Jason,

I believe that the $ENV has to read $main::ENV["myvar-name"] (not true, I just checked it and it works with the $ENV BUT read the next paragraph).

Another thing to check is to try to use the environment name in ALL CAPS. I have an Windoze variable I've added and use. In Windoze, it is entered as 'lower case', but when I run the $ENV using lower case, I get a null string. When I use all CAPS, I return the value.

Now I'd still keep the $main::ENV[] option in mind just in case.

Lynn

---- "Buss wrote:
> I am trying to grab the value of an environment variable (one set by
> another application) in an ACL script placed in the init directory.
> However, it keeps telling me that the $ENV["MY_VAR"] package doesn't
> exist.  Is $main the last package to load?  Is it loading after the init
> directory is read?
>

>
> Thanks,
>

>
> -Jason
>
>      
> ----------     
Top Tags