Hi all ... I have a question about read out a a return value. I am writing a script that uses WWW::Mechanize and the snippet looks like this. ( i wont bore you with all the code )
my $result = $mech->get( $url );
In $result i get the following (produced with Data::Dumper, this is not code but i use the tag's anyway)
$VAR1 = bless( { '_protocol' => 'HTTP/1.1', '_content' => '<!DOCTYPE HTML PUBLIC' MORE HTML STUFF', '_rc' => 404, '_headers' => bless( { 'x-meta-generator' => 'IBM Web +Sphere Studio', 'connection' => 'close', 'client-response-num' => 1, 'last-modified' => 'Wed, 08 Oc +t 2003 17:22:25 GMT', 'date' => 'Tue, 01 Jun 2004 14 +:41:53 GMT', 'client-peer' => '217.127.206. +73:80', 'content-length' => '1045', 'client-date' => 'Tue, 01 Jun +2004 13:00:12 GMT', 'etag' => 'W/"1045-10656337457 +05"', 'content-type' => 'text/html; +charset=ISO-8859-1', 'via' => '1.1 toplist.linkworl +d.ws', 'title' => 'Burke-eSolutions. +Control Acceso Clientes', 'server' => 'Apache Coyote/1.0 +' }, 'HTTP::Headers' ), '_msg' => '/error/HTTP_BAD_GATEWAY.html.var', '_request' => bless( { '_content' => '', '_uri' => bless( do{\(my $o = +'http://toplist.linkworld.ws/cgi-bin/rankem.cgi?id=pala')}, 'URI::htt +p' ), '_headers' => bless( { 'user-a +gent' => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)', 'accept +-encoding' => 'identity' }, 'HTTP: +:Headers' ), '_method' => 'GET' }, 'HTTP::Request' ) }, 'HTTP::Response' );
The question is : Why can i read the content just fine with $result->content And can i not read _rc with $result->rc (nor can i do it with $result->_rc) I hope you guy's can help Paul

In reply to WWW::Mechanize readout vars by pjanzen

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.