Hi Thread GURUS,
    I'm using Linux OS. Does anyone know how to set environment
variables in threads that can be utilized by the system() function.

I have the following code.

This sets all my environment variables and set them correctly.
foreach ( @RESULT )
 {
                my ($ENV_VAR, $ENV_VAL) = split(/\=/);
                chomp(${ENV_VAL});
                $ENV{${ENV_VAR}} = ${ENV_VAL};
        #       print "Each line is \"${ENV_VAR}\"=\"${ENV_VAL}\"\n";
 }

    This prints out everything correctly.
                print `env`;
                 print "ENV{'DIR'} is $ENV{'DIR'}\n";




I run 3 threads.
foreach my $PLATFORM ( @BLD_PLATFORMS )
        {

                        push (@THREADS, threads->create(\&BUILD,
${BLD_CMD}, ${PLATFORM}));
        }

When I call the "system" command, the environment variables I set
doesn't exist? Any idea what I did wrong? How can use or set the env.
variables, so these variables can be used with the system call? any help
or insight will be greatly appreciated.

sub BUILD
{
...more code

 system ("make ...");

}







     - - - - - Appended by Scientific Atlanta, a Cisco company - - - - - 
This e-mail and any attachments may contain information which is confidential,
proprietary, privileged or otherwise protected by law. The information is solely
intended for the named addressee (or a person responsible for delivering it to
the addressee). If you are not the intended recipient of this message, you are
not authorized to read, print, retain, copy or disseminate this message or any
part of it. If you have received this e-mail in error, please notify the sender
immediately by return e-mail and delete it from your computer.

Reply via email to