[p4perl] Error/Warning management of perforce "files" command

TEMPLIE Cédric cedric.templie at echotech.ch
Tue Aug 16 08:27:10 PDT 2005


Hello,

I used the version 3.4804 of p4perl.
I download it again recently to install it on another computer, and 
launch the scripts i wrote with an (it seems) older version of p4perl 
(but still labelized 3.4804).

So my first question  is to know if yes or no it exist different version 
of the same release ?

I say that, because I used the following code to detect if some files 
exist under a label, and it does not work anymore.

$p4->Run("files", $perforcePath."/...@".$perforceLabel) ;
unless($p4->ErrorCount())
{
	//synchronize to $perforceLabel
}
else
{
	//synchronize an other path
}

My issue appear when files return an empty list... When calling the 
command in perforce directly it return :
//my/path/... at MyLabel - no such file(s).

It seems that previously it was recognized by p4perl as an Error, and 
now it is a Warning. So I have to change my code as follow:

$p4->Run("files", $perforcePath."/...@".$perforceLabel) ;
unless($p4->ErrorCount() || $p4->WarningCout())
{
	//synchronize to $perforceLabel
}
else
{
	//synchronize an other path
}


So i just want to know if my intuition are good or not. Because if I am 
wrong, it means that my system is wrong however it seemed  to work.

Thanks in advance for answer.

TEMPLIE Cédric


More information about the p4perl mailing list