19 messages in com.perforce.perforce-user[p4] perl and perforce| From | Sent On | Attachments |
|---|---|---|
| Kate Ebneter | 24 Sep 2001 16:05 | |
| Gareth Rees | 24 Sep 2001 16:26 | |
| Stephen Vance | 24 Sep 2001 16:32 | |
| Kumar Lakshminarayanan | 24 Sep 2001 16:42 | |
| Kumar | 25 Sep 2001 10:14 | |
| Steve Cogorno | 25 Sep 2001 10:28 | |
| Jeremy Russell | 25 Sep 2001 10:41 | |
| Chris Patti | 25 Sep 2001 10:43 | |
| Rick Macdonald | 25 Sep 2001 10:45 | |
| James CE Johnson | 25 Sep 2001 10:49 | |
| Paul Mitchell | 25 Sep 2001 10:52 | |
| Kumar Lakshminarayanan | 25 Sep 2001 10:55 | |
| Mark Lentczner | 25 Sep 2001 10:55 | |
| Gareth Rees | 25 Sep 2001 11:12 | |
| Kumar | 25 Sep 2001 11:15 | |
| Michael Go | 25 Sep 2001 11:23 | |
| Paul Cody | 25 Sep 2001 11:24 | |
| wiv...@us.itmasters.com | 25 Sep 2001 11:50 | |
| Jeff A. Bowles | 25 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




