Hi dear monks, I'm sorry to disturb you again...for problem solved before...but I have a long script...and I parsed as I did before but...now I don't know why it doesn't work...I'm not able to find the errors...the synthax seems ok...I'll paste an example code, because...the code is too long

#!/usr/local/bin/perl use strict; use warnings; use LWP::Simple; use HTML::TreeBuilder; my $url="http://www.ebi.ac.uk/thornton-srv/databases/cgi-bin/pdbsu +m/GetPage.pl?pdbcode=1r9t&template=main.html"; my $content=get ($url); my $chain; my @chains; my $p = HTML::TreeBuilder->new; $p->parse_content($content); my @tds = $p->look_down(_tag => q{td}); for my $td (@tds) { my $a = $td->look_down(_tag => q{a}); next unless $a; if ($a) { my $href = $a->attr(q{href}); if ($href =~ /&chain=(\w)"/) { print $1 qq{\n}; $chain=$1; push @chains, $chain; #I want to extract the chains +....A,B,C,D,E,F,H,I,J,K,L } } $p->delete; }

in this part I only want to print and push into an array the chains of the protein....so that my array would be @chains(A,B,C,etc....) but it doesn't work...If anyone could help me...please...I'm running a little crazy...thanks you all


In reply to problem parsing html by paola82

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.