19 messages in com.perforce.perforce-user[p4] perl and perforce
FromSent OnAttachments
Kate Ebneter24 Sep 2001 16:05 
Gareth Rees24 Sep 2001 16:26 
Stephen Vance24 Sep 2001 16:32 
Kumar Lakshminarayanan24 Sep 2001 16:42 
Kumar25 Sep 2001 10:14 
Steve Cogorno25 Sep 2001 10:28 
Jeremy Russell25 Sep 2001 10:41 
Chris Patti25 Sep 2001 10:43 
Rick Macdonald25 Sep 2001 10:45 
James CE Johnson25 Sep 2001 10:49 
Paul Mitchell25 Sep 2001 10:52 
Kumar Lakshminarayanan25 Sep 2001 10:55 
Mark Lentczner25 Sep 2001 10:55 
Gareth Rees25 Sep 2001 11:12 
Kumar25 Sep 2001 11:15 
Michael Go25 Sep 2001 11:23 
Paul Cody25 Sep 2001 11:24 
wiv...@us.itmasters.com25 Sep 2001 11:50 
Jeff A. Bowles25 Sep 2001 14:47 
Subject:[p4] perl and perforce
From:Chris Patti (cpa@atg.com)
Date:09/25/2001 10:43:09 AM
List:com.perforce.perforce-user

At 10:14 AM 9/25/2001 -0700, Kumar wrote:

Hi all,

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?

Thanks saran

Each system() invocation spawns off a new subshell to execute your command.

set FOO=bar is local to that given shell invocation, so each set sets the variable, but then that value promptly dissappears as the shell ends.

You want to modify the %ENV hash, this will set the environment variables in your currently running process, and so any sub-shells you spawn will take those new values.

-Chris