G
Guest
Hi, I am reading a path from a file and want to set $ENV{'PATH'} with
this path. Then I call a command which will use this path, this
command happens to be gmake.exe but it fails.
Here is the path in the file:
PATH=C:\Program Files\Microsoft Visual Studio 8\VC\bin;C:\Program Files
\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Microsoft
Visual Studio 8\Common7\Tools\Bin;C:\Program Files\Microsoft Visual
Studio 8\Common7\Tools;C:\Program Files\Microsoft Visual Studio 8\VC
\PlatformSDK\Bin;C:\bin\Perl\bin;C:\WINDOWS\system32
Here is my code that reads the Path from the file
foreach my $line (@lines) {
if ($line =~ /PATH=/) {
$path = substr($line,5);
$ENV{'PATH'} = "$path";
print "$path\n";
print "$ENV{'PATH'}"
}
}
But gmake.exe will fail, It will not fail If I hardcode the path in
the perl file but I need to read it from a file instead.
Anyone know what I am doing wrong?
Enda
this path. Then I call a command which will use this path, this
command happens to be gmake.exe but it fails.
Here is the path in the file:
PATH=C:\Program Files\Microsoft Visual Studio 8\VC\bin;C:\Program Files
\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Microsoft
Visual Studio 8\Common7\Tools\Bin;C:\Program Files\Microsoft Visual
Studio 8\Common7\Tools;C:\Program Files\Microsoft Visual Studio 8\VC
\PlatformSDK\Bin;C:\bin\Perl\bin;C:\WINDOWS\system32
Here is my code that reads the Path from the file
foreach my $line (@lines) {
if ($line =~ /PATH=/) {
$path = substr($line,5);
$ENV{'PATH'} = "$path";
print "$path\n";
print "$ENV{'PATH'}"
}
}
But gmake.exe will fail, It will not fail If I hardcode the path in
the perl file but I need to read it from a file instead.
Anyone know what I am doing wrong?
Enda