Change 929

tony_smith (Tony Smith)
Tony Smith committed this change into //guest/tony_smith/perforce/API
Request Review
Download .zip
Add support for form parsing to Perl API.
Allows Perforce
specs (change, client, user etc.) to be parsed by the API
and returned as Perl hashes rather than strings which must
be parsed by the user.

P4 module also has some new methods which make it easy to use
this feature. Sample code:

-------------------
use P4;

my $p4 = new P4;
$p4->ParseForms();
$p4->Init() or die( "Can't connect to Perforce" );

$p4->Edit( "filename" );
my $change = p4->GetChange();
$change->{ 'Description' } = "Some text";
$p4->SubmitSpec( $change );
print( $p4->ErrorCount() ? "Submit failed\n" : "Submit OK\n" );
-------------------
  • Files 4
  • Comments 0
4 edited 0 added 0 deleted
P4-Client/Changes#7
Loading...
P4-Client/README#4
Loading...
P4-Client/lib/clientuserperl.cc#4
Loading...
P4/P4.pm#3
Loading...
Tip: Use n and p to cycle through the changes.