cons-discuss
[Top][All Lists]
Advanced

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

Re: PATH and redirection with Perl 5.6.1 on NT


From: Johan Holmberg
Subject: Re: PATH and redirection with Perl 5.6.1 on NT
Date: Tue, 17 Jul 2001 12:06:08 +0200 (MEST)

On Mon, 18 Jun 2001, Zachary Deretsky wrote:
>
> We compiled from source and installed Perl 5.6.1 on NT.
> We used Perl 5.005_03 before that.
>
> As previously discussed in this group changing $ENV{PATH} did not work on NT
> before.
>
> With 5.6.1 it works as I discovered when some executables were not found on
> the path that I was specifying for the $cons->ENV hash. They were previously
> found (erroneously, given my inadequate $cons->{ENV}{PATH}) because they
> were available on the external cmd PATH.
>

When I saw this email from Zachary Deretsky I was positively
surprised: finally "system" in Perl 5.6 seemed to start behave
sane again.

When I first discovered problems with PATH and "system" in Perl 5.6,
I wrote a little test-script to see how different versions of Perl
behaves.

Today I finally tried to verify Zacharys observation using my
test-script. And it seems to me that the problem is still there :-(

Let me describe how I tested this

    - I created a number of exe's that just "echo" their filename

        ./myprog.exe
        ./myprog
        ./old/myprog.exe
        ./old/myprog
        ./old with spaces/myprog.exe
        ./old with spaces/myprog
        ./new/myprog.exe
        ./new/myprog
        ./new with spaces/myprog.exe
        ./new with spaces/myprog

    - I run a Bourne-shell script (using sh.exe from MKS Toolkit).
      This script sets up the PATH like this:

        PATH="$TOP\\old;$TOP\\old with spaces;$PATH"
        export PATH

    - via another Bourne shell script, I call my script "system.pl" that
      essentially consists of:

        $ENV{PATH} = "$ENV{TOP}\\new;$ENV{TOP}\\new with spaces";
        system "myprog 1 2 3";

      (notice that the new PATH here *doesn't* contain any
       "old" directory)

    - I notice which of all the exe's that get called.
      Then I remove that exe, and run everything again, to see which
      exe is the next one found. And so on until none is left ...

The result I get from Perl 5.6.1 (ActivePerl build 628) is:

        found './myprog'
        found './myprog.exe'
        found './old/myprog.exe'
        found './old/myprog'
        found './old with spaces/myprog.exe'
        found './old with spaces/myprog'
        found './new/myprog.exe'
        found './new with spaces/myprog.exe'

When I run the same script with an old Perl (ActivePerl 5.005_03,
build 518), I get:

        found './myprog'
        found './myprog.exe'
        found './new/myprog.exe'
        found './new/myprog'
        found './new with spaces/myprog.exe'
        found './new with spaces/myprog'


Zachary mentioned that he built 5.6.1 from source, so I tried that also.
Then I got the same result as from the prebuilt 5.6.1.

So my conclusion is that 5.6.1 is sill broken.
No exe from the "old" directories should have been called.

Zachary, is the behaviour I have described here consistent with how
your Perl worked, or does your Perl work differently ?

/johan





reply via email to

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