On 12/01/2011 16:03, Jim Gibson wrote:
At 11:05 PM +1100 1/12/11, Sean Murphy wrote:
Hi All.

I have read the page and the O'rielly book on PWL. I must be thick or
something. but when I dump the content of the web page into the
treeBuilder via a scaler. Then I try and print the tag. I get:

HTML::Element=HASH(0x41b1074)->Tag ( )

Below is the code extract. I have included the HTML:element and
HTML::Treebuilder modules.


print "$child->Tag ( )\n";


Methods and subroutines are not called ("interpolated") within double
quotes. You can call the method and save in a scalar variable, then
print the value of that variable:

my $child_tag = $child->Tag();
print "$child_tag\n";

... or print the value returned from the method directly:

print $child->Tag(), "\n";

Also the method should not be capitalised. It is

  $child->tag()


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to