cons-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Active Perl 5.6.1 build 631 problem with cons?


From: Johan Holmberg
Subject: Re: Active Perl 5.6.1 build 631 problem with cons?
Date: Tue, 8 Jan 2002 15:17:17 +0100 (MET)

On Mon, 7 Jan 2002, Gary Oberbrunner wrote:
>
> I just tried installing ActiveState perl 5.6.1, build 631, and it seems
> to have fundamental problems when it is called *FROM* cons (not when
> calling or interpreting cons).  For instance, this Construct fails:
>
> %e = new cons()->copy();   $e{ENV}{PATH} = "c:/perl/bin";
> $e = new cons(%e);
> $e->Command('foo', qq(perl scr.pl > %>));
>
>
> scr.pl contains:
> print "Hello, World!\n";
>
> If I run this using ActiveState Perl 5.6.1 build 631, I get this output:
> perl scr.pl > foo
> cons: *** [foo] Error 255 (executable not found in path?)
> cons: errors constructing foo
>

I think the problem is that since you use IO-redirection in the
command, "cmd.exe" needs to be in your PATH ("cmd is the equivalent
of Bourne shell on UNIX, and interprets the redirections).

If you change the example line to:

    $e{ENV}{PATH} = "e:/perl-631/bin;D:/WINNT/system32";

it works much better (at least on my  machine).
As far as I can see this is nothing new to ActivePerl build 631.

Since this is such a common situation, I added automatic addition
of the "system32"-directory to my Cons::Plus module. So your
example could be written:

    use Cons::Plus;

    %e = Cons::Plus->new()->copy();
    $e{ENV}{PATH} = "e:/perl-631/bin;" . $e{ENV}{PATH};
    $e = new Cons::Plus(%e);
    $e->Command('foo', qq(perl scr.pl > %>));

So here you don't need to "hardcode" the path to the "system32"
directory. But there is no magic about this, I just use

     $ENV{SystemRoot}/system32

instead of something like D:/WINNT/system32.

I guess ideally, this addition should be done in Cons itself
(it has nothing to do with Visual Studio, which was my main
motivation for creating Cons::Plus in the first place).

/johan holmberg






reply via email to

[Prev in Thread] Current Thread [Next in Thread]