in reply to Re: Data::Dumper output
in thread Data::Dumper output

Update: So I'd say that the unkosher '(' comes from the opening paren in 'HTTP::Request=HASH(0x1c23960)'

You were spot on with the stringification causing the problem. I was trying to put some whitespace between the various Dumper outputs so wrote a rather stupid line of code:

print Dumper %$request . "\n";
Culprit found!!! Sorry for the senior moment!

I think you are right about the source of the opening parenthesis. But I am using an existing module, LWP::Authen::OAuth2 that works. I am only adding a Dumper statement to it to try and understand what it needs that I am not giving it. It should take a hashref. This is the code I am using to call it:

open my $fh, '<', "linkedin.json"; my $json; { local $/; $json = <$fh>; } close $fh; $params = decode_json($json); my $header = { 'X-Restli-Protocol-Version:' => '2.0.0', }; print Dumper $params; print "\n\n============\n\n"; my $res = $linkedin->post('https://api.linkedin.com/v2/ugcPosts', $par +ams, $header); if ($res) { print Dumper $res; exit 0; }
There is an external JSON file so that I can use exactly the example given in the LinkedIn API documentation without introducing data structure errors. The only thing that's changed from that example is the person:id value.

I'm beginning to think that the LinkedIn API is sufficiently recalcitrant to warrant writing a module from scratch for posting to it. Just use the LWP::Authen::OAuth2::ServiceProvider subclass for authentication and not for posting.