UPDATE prepare to dopeslap yourself -- I bet the root problem is that you've misspelled the name of the module HTTP::Headers -- note the 's' on the end! So make that change and go back to your old code. BTW this also makes sense of the error message; the Request object expects the third argument to be an anonymous array of an HTTP::Headers object and an anonymous array of the content, i.e. [$header, [$content]] ... the way it is now, it sees first the reference to the array whose sole member is $content, and that's not a blessed reference.

bless is a perl function that's used in Object oriented programming -- you use it to 'bless' an object into a class, to mark it as an object (rather than a plain ol' reference). The basic idea is that a reference must be *blessed* before you can call *methods* on it, and somwhere inside HTTP:Message, something that's not an object (because it hasn't been blessed) is being treated as if it were.

What's going on is that one of the modules you are using uses HTTP::Message internally -- and there are a couple of candidates here (HTTP:::Request is a subclass of HTTP::Message) -- and you've subtly messed up a call to a constructor. I'm not feeling generous enough with my time to track down *which* one for you, but go over the documentation for the objects you're instantiating and make sure those calls pass in the right kinds of arguments.

I'm not sure you need to explicitly use all those modules, either. Try it with just use LWP::UserAgent left in there and see if that works. It may even solve your problem.

Side note: when you get errors you don't understand, you can often get a lot more info by calling perldoc perldiag and searching for (the generic part of) your error message. Similar results can be obtained by putting use diagnostics at the top of your script.


In reply to Re: Submitting information to an online form by arturo
in thread Submitting information to an online form by cobra

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.