On 8/7/07, Sumit Sahu <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I am running into a strange problem when running perl on
> Windows. Basically, the 'system' command seems to be
> exitting abruptly. I traced it down and found that this
> problem occurs only when the PATH variable is too long (Yet
> to define how long is too long but the common observation is
> around 6000 characters ) and when another variable is set to be
> the same as PATH. Under such an environment, when I run a perl
> script containing just the following :
> system("echo hello");
>
> the system command just doesnt seem to work.   I am using
> perl-5.6.0.623.
> Is there a limit on the length of an environment variable or
> the total number of environment variables ?  Perl is used
> heavily in our field and I have been running into these
> problems since a long time, therefore any
> pointers/suggestions  would be greatly appreciated.
snip


Unfortunately, I cannot duplicate your problem.  Does this script run
correctly on your system?

#!/usr/bin/perl

use strict;
use warnings;

$ENV{OTHER} = $ENV{PATH};
for my $i (1 .. 100) {
    $ENV{PATH} .= sprintf ";c:\\winxp\\%050d", $i;
    $ENV{OTHER} .= sprintf ";c:\\winxp\\%050d", $i;
    my $len = length $ENV{PATH};
    system "echo $i is $len >> bar.txt";
}


If so, then please modify it until it demonstrates your issue and we will
try to find a solution for you.

Reply via email to