On Tue, 25 Sep 2001, saravanakumar chinnaraj wrote:

> this question is more of perl than perforce, but i thought that some might
> have the answers.
>
> Here is my piece of code, i was unable to set the p4client from perl.
>
> #!D:\Perl\bin -w
>
> # setting P4 Client
> system("set P4CLIENT=iandb");
> system("set P4PORT=perforce:1666");
> open(OUTFILE,"p4 client -o |");
> while(<OUTFILE>){
>         print $_;
> }
>
> The above script doesn't set the client to iandb. can anyone help me in this
> regard?

I betcha this is a Windows environment problem and not a Perl problem.
You are setting Windows environment variables with the system command, and
those variables are probably only set for the current session they are
called in.  In other words, those variables are only set for the duration
of the system call, and then 'go out of scope' after the system call
finishes (unless there is something equivalent to the Unix 'export'
command in Windows).  What you might want to do instead is create a batch
file that sets those variables first, then call the Perl script inside the
batch file after those variables are set.

-- Brett
                                          http://www.chapelperilous.net/
------------------------------------------------------------------------
If builders built buildings the way programmers wrote programs,
then the first woodpecker to come along would destroy civilization.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to