Hi,

I am running a perl script in a command inside make. I am trying to pass an environment variable to perl, modify it inside perl and see it changed inside make after returning from the perl script.

What is happening is that perl see the environment variable and tries to modify it but make sees no change in the value of the environment variable after return from the perl script.

Can someone tell me what I am doing wrong? The two programs are listed below with the runtime terminal listing below them.

This is the make file:
MAKE_VAR1 = original value of MAKE_VAR1
export MAKE_VAR1

targ1 :
        @echo  From make before perl: ${MAKE_VAR1}
        @perl scr.pl
        @echo  From make after perl: ${MAKE_VAR1}


This is the perl file:
#!/usr/bin/perl -w

use Env;
Env::import(MAKE_VAR1);

print "Perl input $MAKE_VAR1\n";


$MAKE_VAR1 = "new value in MAKE_VAR1";

print "Perl output $MAKE_VAR1\n";

This is the terminal listing:
From make before perl: original value of MAKE_VAR1
Perl input original value of MAKE_VAR1
Perl output new value in MAKE_VAR1
From make after perl: original value of MAKE_VAR1


Thanx,

Ayoub890

Reply via email to