[p4perl] Problems with Perl/Perforce Integration
Tony Smith
tony at smee.org
Thu Jan 5 10:11:41 PST 2006
On Thursday 05 January 2006 17:04, Weintraub, David wrote:
> Thanks for the information. Yes, I see the various Fetch<Cmd> Methods
> under shortcuts to the Run method at the very end of the documentation.
>
> I still don't entirely understand what the ParseForms() method does. I
> was told that ParseClient needed it, so I put it in the program.
ParseForms() causes P4Perl to convert forms sent by the Perforce Server as
plain text into Perl Hashes and vice versa. Without it, all you'll get if you
run FetchClient() is a string containing the entire client spec.
> I understand it is some sort of switch, and I understand what it does
> when it is "on" (it tells various command that get Perforce forms to
> parse those forms and put the results in a hash). However, I'm not 100%
> sure what happens when I use the FetchClient() method if I didn't call
> ParseForms() first. Does FetchClient() return a multi-lined string? Will
> it fail? I'll have to give that a try.
Yep, just a multi-lined string.
> I like the P4 object interface, and will convert a lot of my scripts to
> use it.
Thanks! I'm glad you like it.
> The one thing I would like to see in P4.pm is a mode that works
> via with the P4 command line executable in case you can't use the API
> libraries.
It's probably do-able, though not all features would make it. You'd need to
read/write either Python or Ruby marshalled format since that's what p4
supports, but it's possible.
Personally, I'd rather not do it though. It takes a little more work to set
up, but P4Perl is cleaner, faster and more functional for using the API.
> I have no problems installing this on my Windows XP box, but my Solaris
> box is proving a bit difficult. I am not an administrator on it, and it
> isn't easy to get our admins to install a package like this. It would be
> much easier if I could simply say to our admins, "Copy this one file to
> '/usr/local/lib/perl/site'". With the current package, I'll have to
> figure out how to compile it, where certain files have to go, give the
> admins detailed directions of which files need to go in what
> directories.
Can't they just cd to your build directory and run a 'make install'?
If not, you could always install it into your own location and have Perl look
there for it. I'm sure there's an environment variable for this
(PERL5LIB???), but I've never had to use it so I'm not sure of the name.
Try this:
perl Makefile.PL PREFIX=$HOME/p4perl
make
make test
make install
Hope that helps!
Tony
More information about the p4perl
mailing list