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.


In reply to Re^2: Data::Dumper output by Bod
in thread Data::Dumper output by Bod

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.