Thanks for the help! That worked great for printing to the cmd prompt...I have one last question, and then I'm going to try to get it to do the rest myself.

Each of the above lines needs to be put into a database field in other words in your example you printed:

my @cells = $r->look_down(
_tag => q{td},
width => q{48%},
valign => q{top},
);

Output:
SERVPRO® of Central Alabama II
Wilson, David & Christie
Phone: (205)678-2224
Fax: (205)678-2226
http://www.servpro.com/franchises/enhanced_asp/default.asp?fn=2226

How would I pull out the following information into different variables such as:

$location = SERVPRO® of Central Alabama II
$phone = (205) 678-2224
$fax = (205) 678.2226
$website = http://www.servpro.com/franchises/enhanced_asp/default.asp?fn=2226

Also, I had a few questions about the functions in your code and hope you could tell me what they do in plan english so that I can start implementing them? :)

Here is the code you created:

for my $cell (@cells){

my $bold = $cell->look_down(_tag => q{b});
print $bold->as_text, qq{\n};

for my $item ($cell->content_refs_list) {
next if ref $$item;
print $$item, qq{\n};
}

My first question is on

for my $item ($cell->content_refs_list)

Here is what I understand. The "for" loop is creating a new value for $item for each item in the array ($cell->content_refs_list), correct? So what is the $cell->contents_ref_list creating, and how does it know to create a new line at each break in the data? In general, what does the "->" do, and what does "content_refs_list" refer to?

Next you print $$item. Why use two $$ here?

I think I understand the rest, so if you could explain and help me with the points above, I should be good to go! Thanks for the awesome help...OOOMMMM!!! :)


In reply to Re^2: PERL HTML::TableExtractor by jdlev
in thread PERL HTML::TableExtractor by jdlev

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.