Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Perl HTML confusion...

by marinersk (Priest)
on Sep 17, 2013 at 17:59 UTC ( [id://1054500]=note: print w/replies, xml ) Need Help??


in reply to Perl HTML confusion...

Welcome AI Cowboy,

On the same page you mention ( http://search.cpan.org/~cjm/HTML-Tree-5.03/lib/HTML/Element.pm ), if you scroll to the top and search for $h, the first hit shows:

BASIC METHODS
new
$h = HTML::Element->new('tag', 'attrname' => 'value', ... );

This constructor method returns a new HTML::Element object. The tag name is a required argument; it will be forced to lowercase. Optionally, you can specify other initial attributes at object creation time.

What might not have been clear to you is that this was intended to set your expectations that all references to $h on that page were going to refer to an instantiated HTML::Element object.

As to your original request (recommend a module), I'll leave that to the Monks who dabble far more often in HTML manipulation than I do.

Good luck in the hunt!

Replies are listed 'Best First'.
Re^2: Perl HTML confusion...
by AI Cowboy (Beadle) on Sep 17, 2013 at 18:06 UTC

    That makes sense - but that raises one more question I have, an HTML::Element object such as $h is one element, or all the elements on a page? basically... $a = HTML::Element->new('a', href => 'http://www.perl.com/'); What does this instantiate? Is it looking for all links on the page www.perl.com? Sorry if this is a silly question, never used these objects/modules before today/yesterday :)

      Yeah, sorry for opening Pandora's Box and then running away.

      Whatever the HTML::Element object is, $h is a single instance of that object. What is it? I'd have to read the documentation, same as you.

      I would expect that someone who actually uses the module will wander by and pick up the torch here. My advice on this topic would be increasingly (if that's even possible) more theoretical than it already is.

      bless({ _tag => "a", href => "http://www.perl.com/" }, "HTML::Element")

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1054500]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-03-29 06:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found