[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[offtopic] perl newbie frustrated


Apologies for this being off-topic, but this is the best "perl resource" I have.

<vent>

I've been trying for the past 2 hours to get Frontier::Client working (XML-RPC). I originally tried RPC::XML but that dude's documentation was lacking some serious examples. So is F::C, but I found several HOWTO's and finally pieced that one together.

I struggled over and over trying to get this client working. The PHP client was so, so simple. The call takes 3 args: userID, pass, and an array containing the course ID's to add you too.

my @addUser = ( 332, 'mypass', (22, 74, 98));

Didn't work. It exploded the inner array into more params for the main array. I knew XMLRPC worked with array's and struct's but found no examples.

Finally stumbled onto this and tried it:

my @addUser = ( 332, 'mypass', [22, 74, 98]);

Amazingly, that worked. I've never seen this type of [ ] notation so I tried it out:

my $test = [2, 4, 8];
print $test;
>Array(0x3038303)

Oh? That's an array format. OK. Try this:

my @test = (2, 4, 8);
print @test;
>248

??? Confused.

If anyone could please explain what I missed on the differences between ( ) array's and [ ] array's, I'd appreciate it.

And for cookie points, if anyone knows how to do a real struct in XMLRPC, that would be awesome.

</vent>

Cheers,
Matthew


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.