[p4perl] Help for a beginner

John Hughes john.hughes@hands.no
Tue, 21 Dec 2004 09:31:23 +0100


Hello,

I am keen to try and code some scripts which will automate a number of
little tasks for us. As I already have perl 5.6, I simply downloaded
P4perl and attempted to use the "Synopsis" code to get me started:

P4::Client::Run() - Client has not been initialised at
:/Perl/site/lib/P4.pm line 223.
Failed to connect to Perforce Server at p4perl.pl line 11.


I am clearly missing something ... Here is my code:

use P4;
my $p4 = new P4;
$user = "<<myP4Username>>";
$clientname = "<<myP4ClientSpecName>>";
$p4port = "<<myP4serverHost:port>>";

$p4->SetUser ( $user );
$p4->SetClient( $clientname );
$p4->SetPort ( $p4port );
#$p4->SetPassword( $p4password );
$p4->Connect() or die( "Failed to connect to Perforce Server" );

my $info = $p4->Run( "info" );
#$p4->Edit( "file.txt" ) or die( "Failed to edit file.txt" );
$p4->Disconnect();

I am working on Windows XP.


Regards

John Hughes