[p4perl] Perl form converter ignores numbers +PATCH

John LoVerso John.LoVerso at mathworks.com
Wed Aug 29 06:47:13 PDT 2007

We had some test code that effectively did this:

	my %spec = ( Change=>1, ...);
	$p4->SubmitSpec( \%spec);

This was getting this error:
	Error in change specification.
	Missing required field 'Change'.

The problem ended up being that PerlClientUser::HashToForm() would
ignore any hash value that wasn't a string.  The above really needs to

	my %spec = ( Change=>'1', ...);

The '_Run' method converts numbers to strings when processing an
list (the code says "Be friendly and convert numeric args to char *'s),
so it was surprising that this wasn't true for forms.

I've enclosed a patch to add this conversion for forms, and to produce
a warning when it encounters a form field it can't handle.  (The warning
could be improved to give the key it's complaining about).

John + Steve

John LoVerso
The MathWorks 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: perlclientuser.cc.patch
Type: application/octet-stream
Size: 676 bytes
Desc: perlclientuser.cc.patch
URL: <http://maillist.perforce.com/pipermail/p4perl/attachments/20070829/a969d547/attachment-0001.obj>

More information about the p4perl mailing list