D
danfperl
I'm trying to load an environment file in a script and I think it may
be easiest to show it before explaining it. I've got 2 files,
/tmp/test.pl and /tmp/test.env. Here are the contents.
test.env:
#!/usr/bin/ksh
export BLAH=TEST
test.pl:
#!/usr/local/bin/perl
system('. /tmp/test.env');
print "\$BLAH is ${BLAH}" ;
When I run it I get:
sh: BLAH=TEST: is not an identifier
$BLAH is
How can I get Perl to load the file properly? It does so from the
command line but throws the error when I run the script. For reasons I
can't get into I can't change the env file - the perl script needs to
be modified. Any help is greatly appreciated!!
Dan
be easiest to show it before explaining it. I've got 2 files,
/tmp/test.pl and /tmp/test.env. Here are the contents.
test.env:
#!/usr/bin/ksh
export BLAH=TEST
test.pl:
#!/usr/local/bin/perl
system('. /tmp/test.env');
print "\$BLAH is ${BLAH}" ;
When I run it I get:
sh: BLAH=TEST: is not an identifier
$BLAH is
How can I get Perl to load the file properly? It does so from the
command line but throws the error when I run the script. For reasons I
can't get into I can't change the env file - the perl script needs to
be modified. Any help is greatly appreciated!!
Dan