Greetings Monks.

Short question. I am getting unwanted output from a module that I'm using WWW::Curl::new. i.e. It's printing information to STDOUT when run in the CGI and doesn't appear to give me an option to turn that output off.

My question is: Does anyone know of a way of capturing STDOUT when a third party module spits out unwanted information? And, does anyone know of a way to turn off the information that is spit out of WWW::Curl::new?

Here is a sample of the WWW::Curl::new code that I'm using. It is not a full working example as you'll need a cURL server to test it on, and I'm unable to allow access to my server.

my ($headers, $body) = ('',''); use WWW::Curl::easy; my $curl = WWW::Curl::easy->new(); my $CURLcode = $curl->setopt(CURLOPT_WRITEFUNCTION, \&callback); $CURLcode = WWW::Curl::easy::setopt($curl, CURLOPT_URL, $broker_ur +l); $CURLcode .= WWW::Curl::easy::setopt($curl, CURLOPT_HEADER,\$heade +rs); $CURLcode .= WWW::Curl::easy::setopt($curl, CURLOPT_POSTFIELDS, $p +ost_vars); $CURLcode .= WWW::Curl::easy::perform($curl); WWW::Curl::easy::cleanup($curl);


The callback() sub references above:
sub callback { my ($data,$pointer)=@_; $params{'data'} .= $data; return length($data); }


This is the unwanted information that is spit out:
HTTP/1.1 200 OK Date: Mon, 14 Mar 2005 01:42:55 GMT Server: Apache/2.0.40 (Red Hat Linux) Accept-Ranges: bytes X-Powered-By: PHP/4.2.2 Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=ISO-8859-1


Any help is appreciated, Cheers.

In reply to Unwanted output to STDOUT in WWW::Curl::new by snookmz

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.