in reply to using HTML::TreeBuilder effectively
Hello Datz_cozee75,
(1) When I enter http://dailynews.yahoo.com/h/tc/ — or even just http://dailynews.yahoo.com — into Google Chrome, I get:
This web page is not available
ERR_NAME_NOT_RESOLVED
...
The server at dailynews.yahoo.com can't be found because the DNS look-up failed....
Looks as though the web address has changed to http://news.yahoo.com/?
(2) Is there a question 2?
(3) Within the call to map, each element of the array @links is in turn aliased to $_ (see map). @links was previously initialised via a call to get_headlines(), which returns the elements in @out. The latter is populated by this line:
push @out, [ $link->attr('href'), $link->as_text ];
which creates an anonymous array containing two elements, and pushes a reference to it onto the array @out (see perlreftut). So, within the map, $_->[0] is the first element of the anonymous array currently referenced by $_, and $_->[1] is the second element.
(4) Sorry, I don’t know how to get just the headlines from http://news.yahoo.com/.
Anyway, hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|