Greetings, esteemed monks!

I get this...esoteric? error: Can't bless non-reference value at C:/Perl64/site/lib/HTML/ElementTable.pm line 431. With the following code:

#!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; use WWW::Mechanize; use Readonly; use HTML::TreeBuilder; #use HTML::Element qw(Table); #use HTML::TableExtract qw(tree); use HTML::TableExtract; use HTML::Encoding 'encoding_from_http_message'; use Encode; use File::Slurp; Readonly::Scalar my $url => 'http://www.emarketplace.state.pa.us/Searc +h.aspx'; my $mech = WWW::Mechanize->new( agent => 'Mozilla/5.0 (Windows NT 6.1; + WOW64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2' ); $mech->get($url); #There is only one form on the page and they start at 1 in WWW:Mechani +ze my $form = $mech->form_number(1); # 'wucSearch$btnSearch' is the NAME of the button we want to press; 'w +ucSearch_btnSearch' is the id # 'wucSearchResults$ddlRows' is the NAME of the input item we want to +set to 'ALL' $mech->select('wucSearchResults$ddlRows','ALL'); my $response = $mech->click_button(name => 'wucSearch$btnSearch'); if ($response->is_success) { #print $response->decoded_content; # or whatever } else { die $response->status_line; } my $HTML = $response->decoded_content; #my $te = HTML::TableExtract->new(slice_columns=> 0, keep_html => 1);# +, headers => ["Solicitation#"]); my $te = HTML::TableExtract->new(); $te->parse($HTML);
I tried taking out the qw(tree) in the use HTML::TableExtract line.

I see one other node about a similar error: Net::Packet::Dump can't bless non-reference as 'IO::File' but I don't really see how this would apply to me.

Without further ado, how do I fix this? Thanks!


I like computer programming because it's like Legos for the mind.

In reply to "Can't bless non-reference value" error with HTML::TableExtract by OfficeLinebacker

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.