The problems which I encountered with
WWW::SimpleRobot related to the
traverse function not returning traversal results via the
$object->pages and
$object->urls methods - The problem appeared to relate to the
shift method by which the author was iterating through the constructed queue undefining the
@pages results array before it was returned at the end of the function.
Better than just reporting this to the author, I have submitted a fix patch which corrects this behaviour by pushing results into a separate array to the queue.
115a116
> my @results;
150a152
> push (@results, $page);
165,166c167,168
< $self->{pages} = \@pages;
< $self->{urls} = [ map { $_->{url} } @pages ];
---
> $self->{pages} = \@results;
> $self->{urls} = [ map { $_->{url} } @results ];
Note that I never meant for my little piece of code to be viewed as a code fork from WWW::SimpleRobot but rather just an additional available option.
Ooohhh, Rob no beer function well without!
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.