I am new to the Perforce source control and I am trying to build a script that login to the server and get files to the working directory. Now I am able to connect to the server, set the working folder but I can not get the client.
This is the code of the connection to the server
$p4 = new P4;
$p4->SetProg($ScriptName);
$p4->SetVersion($ScriptRevision);
$p4->SetCharset($ENV{P4_CHARSET});
$p4->SetPort ($ENV{P4_IP_AND_PORT});
$p4->SetClient($ENV{P4_CLIENT});
$p4->SetUser($ENV{P4_USER});
$p4->SetPassword($ENV{P4_PWD});
$p4->Connect() or die "blblblblblb" ;
$p4->SetCwd($Working_dir); ## the dir exists
Now I need to create the client. Is this is the way ?
$p4->FetchClient( $ENV{P4_CLIENT} );
I am getting back an object , but the
Runsync command fail with error
Client 'xxxxxx' unknown - use 'client' command to create it
My question is how to create the client in Perl and how to use it in the sync command.