[p4] Problem running p4 command line from a perl script.

Biswajit Dash biswajitind at yahoo.com
Wed Jun 27 04:12:13 PDT 2007


Hi all, 
 I got it myself. 
I was aproaching the problem from a wrong direction :(

Here is what i do.

my $ticket = `p4 login -p $user `;
chomp($ticket);
@changes = `p4 -u $user -P $ticket changes -s
pending`;

Regards,
Biswajit.

--- Biswajit Dash <biswajitind at yahoo.com> wrote:

> Hi All, 
> I have a perl script which executes p4 commandline
> to
> find out list of pending changelists.
> 
> When I execute the p4 command in commandline, It
> works
> fine. however when the same command gets executed
> from
> the script, I get 
> Perforce password (P4PASSWD) invalid or unset.
> 
> I am sending the 
> script and command/output logs 
> 
> xyz at biswajit>>cat test.pl 
> #!/usr/bin/perl
> my $p4 = 'p4 ';
> 
> my $cmd = "$p4 users";
> my @output = `$cmd`;
> print("CMD:$cmd\nOUTPUT:@output\n\n");
> 
> $cmd   = "$p4 -u padmin changes -s pending";
> @output = `$cmd`;
> print("CMD:$cmd\nOUTPUT:@output\n\n");
> 
> ##############End of script##############
> xyz at biswajit>> p4 counter security
> 3
> xyz at biswajit>> perl test.pl 
> CMD:p4  users
> OUTPUT:bruno <bruno at padmin_ws> (bruno) accessed
> 2007/06/27
>  padmin <padmin at padmin_ws> (padmin) accessed
> 2007/06/27
> 
> 
> Perforce password (P4PASSWD) invalid or unset.
> CMD:p4  -u padmin changes -s pending
> OUTPUT:
> 
> xyz at biswajit>> p4  -u padmin changes -s pending
> Change 12 on 2007/06/27 by padmin at padmin_ws_unix
> *pending* 'new '
> Change 9 on 2007/06/27 by padmin at padmin_ws_unix
> *pending* 'A New number changelist from Un'
> Change 8 on 2007/06/27 by padmin at padmin_ws *pending*
> ''
> 
> 
>  
>
____________________________________________________________________________________
> Expecting? Get great news right away with email
> Auto-Check. 
> Try the Yahoo! Mail Beta.
>
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html
> 
> 



       
____________________________________________________________________________________
Pinpoint customers who are looking for what you sell. 
http://searchmarketing.yahoo.com/


More information about the perforce-user mailing list